Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> How to Post Previous Days transactions on next day
Hi,
Oracle 9i Rel2
I have an objective to show last working days transaction (Friday) on
Saturday and Sunday,
AND
if the next day is also a Holiday then i have to post previous days
transactions on Holiday too.
Example:I need to show Friday Sep 1,2006 Transactions on
Sep 2,2006
Sept 3,2006
Sep 4,2006 (Labor Day -- Holdiay)
Here is the Query that i have written which takes care of Sat and Sundays.Iam having problem with Posting the data on Holidays.
select TRANS_DATE, Case when MY_ID = 'XXXEX5' then SUM(PRINCIPAL) End as XXXDirect, Case when MY_ID = 'XXXEX5' then trunc(AVG(RATE),2) End as XXXDirect_Avg, Case when MY_ID in ('XXXEX3', 'XXXEX2', 'CLS') then SUM(PRINCIPAL) End asXXXBroker,
Case when MY_ID in ('XXXEX3', 'XXXEX2', 'CLS') then trunc(AVG(RATE),2) End as XXXBroker_Avg, Case when MY_ID in ('EPIEX3', 'ACK', 'ETCEX3', 'CKD') then SUM(PRINCIPAL)End as Euro3,
Case when MY_ID = 'XXXEX5' then SUM(PRINCIPAL) End as XXXDirect, Case when MY_ID = 'XXXEX5' then trunc(AVG(RATE),2) End as XXXDirect_Avg, Case when MY_ID in ('XXXEX3', 'XXXEX2', 'CLS') then SUM(PRINCIPAL) End asXXXBroker,
Case when MY_ID in ('XXXEX3', 'XXXEX2', 'CLS') then trunc(AVG(RATE),2) End as XXXBroker_Avg, Case when MY_ID in ('EPIEX3', 'ACK', 'ETCEX3', 'CKD') then SUM(PRINCIPAL)End as Euro3,
Case when MY_ID = 'XXXEX5' then SUM(PRINCIPAL) End as XXXDirect, Case when MY_ID = 'XXXEX5' then trunc(AVG(RATE),2) End as XXXDirect_Avg, Case when MY_ID in ('XXXEX3', 'XXXEX2', 'CLS') then SUM(PRINCIPAL) End asXXXBroker,
Case when MY_ID in ('XXXEX3', 'XXXEX2', 'CLS') then trunc(AVG(RATE),2) End as XXXBroker_Avg, Case when MY_ID in ('EPIEX3', 'ACK', 'ETCEX3', 'CKD') then SUM(PRINCIPAL)End as Euro3,
*****My constraint is no PL/SQL and no DML is allowed.*
Please let me know is there anyway i can achieve this.*I tried using Lag(), it did not work for me,Any suggestions?*
--
Regards & Thanks
Jayanth
-- http://www.freelists.org/webpage/oracle-lReceived on Wed Sep 06 2006 - 07:04:39 CDT
![]() |
![]() |