MwTV
MIS
- Mar 9, 2007
- 99
Just received a request for a weekly report that has the following columns;
Wk Beginning Date (1)
Number of Accts Received (2)
$ Amount for Accts Received (3)
No. of Accounts Reviewed (4)
Amount of Accounts Reviewed (5)
$ Amt of Payments Received During Week (6)
$ Amount of Payments - YTD (7)
The report is to be distributed on Fridays. The Week Beginning date is every Monday. However, there might be a need to enter date parameters later instead of having the Week Beginning date always defaulted to Mondays.
My initial response to this was that a union query is needed. Something like
Select count(tblAccounts.AcctNo) where tblAccounts.DateRecordCreated between
trunc(sysdate) - 4 and trunc(sysdate)
Union
Select total_charges from tblAccounts
where (select count(tblAccounts.AcctNo) where
tblAccounts.DateRecordCreated between trunc(sysdate) - 4 and trunc(sysdate)
Union
Select count(tblAccounts.AcctNo) where tblAccounts.DateReviewed between
trunc(sysdate) - 4 and trunc(sysdate)
Union
.
.
.
and so on
Any assistance is greatly appreciated.
Thanks in advance.
Wk Beginning Date (1)
Number of Accts Received (2)
$ Amount for Accts Received (3)
No. of Accounts Reviewed (4)
Amount of Accounts Reviewed (5)
$ Amt of Payments Received During Week (6)
$ Amount of Payments - YTD (7)
The report is to be distributed on Fridays. The Week Beginning date is every Monday. However, there might be a need to enter date parameters later instead of having the Week Beginning date always defaulted to Mondays.
My initial response to this was that a union query is needed. Something like
Select count(tblAccounts.AcctNo) where tblAccounts.DateRecordCreated between
trunc(sysdate) - 4 and trunc(sysdate)
Union
Select total_charges from tblAccounts
where (select count(tblAccounts.AcctNo) where
tblAccounts.DateRecordCreated between trunc(sysdate) - 4 and trunc(sysdate)
Union
Select count(tblAccounts.AcctNo) where tblAccounts.DateReviewed between
trunc(sysdate) - 4 and trunc(sysdate)
Union
.
.
.
and so on
Any assistance is greatly appreciated.
Thanks in advance.