Hi All,

I have this problem, I'm not sure what happenned. It only happepned when i Code in asp classic. It work fine in SQLDeveloper and ColdFusion same query and same data output.
The Query : -

in asp :

strSQL = "select option_id, option_description,insurance_cost_rec_percent,gove rnment_cost_rec_percent,DOCUMENT_REC_INFO," & _
" option_short_name, probability_of_occurance,decile_selected_ind, option_selection_rationale,currency_id," & _
" option_number_selected,option_budget_aggregate_tot al,probability_of_occurance," & _
"NVL((SELECT no_of_years-DECODE(TO_CHAR(p.current_budget_year,'YYYY') + TO_NUMBER(TO_CHAR(MIN(wbs_budget_date), 'YYYY')),NULL, " & _
"0, TO_CHAR(p.current_budget_year,'YYYY') - TO_NUMBER(TO_CHAR(MIN(wbs_budget_date), 'YYYY'))) no_of_years"& _
" FROM wbs_budget_amt WHERE option_id = options.option_id AND prj_version_id = " & cstr(Version_ID) & _
" AND prj_master_id = project_master.prj_master_id),0) no_of_years1,"& _
" NVL((SELECT TO_NUMBER(TO_CHAR(MAX(wbs_budget_date),'YYYY')) -TO_NUMBER(TO_CHAR(MIN(wbs_budget_date),'YYYY'))+1 "& _
" FROM wbs_budget_amt , portfolio WHERE option_id = options.option_id " & _
" AND prj_version_id = " & cstr(Version_ID) & _
" AND prj_master_id = project_master.prj_master_id AND WBS_BUDGET_DATE >= CURRENT_BUDGET_YEAR),0) no_of_years " & _
" from project_version, project_master, options, portfolio p where p.portfolio_name = 'TRW' " & _
" AND project_version.prj_master_id = project_master.prj_master_id and project_version.prj_master_id = options.prj_master_id "& _
" and project_version.prj_version_id = options.prj_version_id and options.active_ind='Y' "& _
" and project_master.prj_master_id= " & cstr(Project_ID) & _
" and project_version.prj_version_id= " & cstr(Version_ID) & _
" order by options.probability_of_occurance desc,option_short_name"


in sql developer and CF :-

select option_id, option_description,insurance_cost_rec_percent,
government_cost_rec_percent,DOCUMENT_REC_INFO, option_short_name,
probability_of_occurance,decile_selected_ind, option_selection_rationale,
currency_id, option_number_selected,option_budget_aggregate_tot al,
probability_of_occurance,
NVL((SELECT no_of_years-DECODE(TO_CHAR(p.current_budget_year,'YYYY') + TO_NUMBER(TO_CHAR(MIN(wbs_budget_date), 'YYYY')),NULL, 0, TO_CHAR(p.current_budget_year,'YYYY') - TO_NUMBER(TO_CHAR(MIN(wbs_budget_date), 'YYYY'))) no_of_years
FROM wbs_budget_amt
WHERE option_id = options.option_id
AND prj_version_id = 5099
AND prj_master_id = project_master.prj_master_id),0) no_of_years1, NVL((SELECT TO_NUMBER(TO_CHAR(MAX(wbs_budget_date),'YYYY')) -TO_NUMBER(TO_CHAR(MIN(wbs_budget_date),'YYYY'))+1 FROM wbs_budget_amt , portfolio
WHERE option_id = options.option_id
AND prj_version_id = 5099
AND prj_master_id = project_master.prj_master_id
AND WBS_BUDGET_DATE >= CURRENT_BUDGET_YEAR),0) no_of_years
from project_version, project_master, options, portfolio p
where p.portfolio_name = 'TRW'
AND project_version.prj_master_id = project_master.prj_master_id
and project_version.prj_master_id = options.prj_master_id
and project_version.prj_version_id = options.prj_version_id
and options.active_ind='Y'
and project_master.prj_master_id= 50
and project_version.prj_version_id= 5099
order by options.probability_of_occurance desc,option_short_name



Can anyone help me on this. Why it doesnt work in asp?

Regards,
Shaffiq