We have just upgraded to 10g. I have a query that has been working fine until the upgrade, and I have narrowed down the problem to the combination of "AND" and "OR" in my WHERE clause. The problem is that one column (rate_mult) is returning the wrong rate multiple for all records and therefore throwing off all the currency conversions. If I seperate the query with a "UNION ALL" the rates returned are correct. Something else I noticed, if I seperate the query into individual accounting periods, again the rate returned is correct.
Are there any bugs when combining AND and OR? Like I said, this query hasn't changed in years. Very odd.
Thanks,
TN
Are there any bugs when combining AND and OR? Like I said, this query hasn't changed in years. Very odd.
Code:
select T1.BUSINESS_UNIT, T1.OPERATING_UNIT , T1.ACCOUNT, T1.PRODUCT ,
T1.DEPTID , T1.CHARTFIELD1, T1.CHARTFIELD2, T1.CHARTFIELD3,
T1.FISCAL_YEAR , T1.ACCOUNTING_PERIOD , T1.POSTED_BASE_AMT *1,
T1.POSTED_BASE_AMT*T2.RATE_MULT , T2.RATE_MULT
from SYSADM.PS_TDS_COG_RATE_VW T2, SYSADM.PS_TDS_COG_MTD_VW T1
where T2.FROM_CUR=T1.BASE_CURRENCY
and T2.FISCAL_YEAR=T1.FISCAL_YEAR
and T2.ACCOUNTING_PERIOD=T1.ACCOUNTING_PERIOD
[b] and (T1.TDS_CAL_BASE_CUR='CAD' OR (T1.BUSINESS_UNIT in ('04473','04470'))) [/b]
and T1.LEDGER in ('MTD_ADB', 'ADBMTDCONS')
and T1.FISCAL_YEAR = 2006 AND T1.ACCOUNTING_PERIOD <=11
Thanks,
TN