Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help bulit a query

Status
Not open for further replies.

Crystalboy1

Programmer
Sep 4, 2007
89
GB
Can anyone help me built a SQL query to to select this data and calculate the accrual according to the detials given below.

On a Friday the report will accrue for three days (ie for Fri, Sat and Sun) using the amount outstanding
For example : -
BusinessDay Amount Accrual

Thurs 40 2,739.72
Fri 40 8,219.18 *

Mon 60 3,424.66


* Fri 40 2,739.72
Sat 40 2,739.72
Sun 40 2,739.72

8,219.18



3.4.7 Where the monthend date occurs on a Saturday or Sunday, the accrual on Friday should include the accrual for the 30th and/or 31st , calculated on Fridays CoB position.
For example : -
Sun 31st
BusinesDay Amount DMO Accrual

Thurs 28th 40 2,739.72
Fri 29th 40 8,219.17*
Sat 30th
Sun 31st
Mon 1st 40 2,739.72


* Fri 29th 40 2,739.72
Sat 30th 40 2,739.72
Sun 31st 40 2,739.72
8,219.17



Sun 1st
BusinessDay Amount Accrual


Thurs 29th 40 2,739.72
Fri 30th 40 5,479.45*
Sat 31st
Sun 1st
Mon 2nd 40 5,479.45**

* Fri 30th 40 2,739.72
Sat 31st 40 2,739.72
5,479.45

** Sun 1st 40 2,739.72
Mon 2nd 40 2,739.72
5,479.45




Where the 1st of the month occurs on a Saturday or Sunday, the accrual on Monday should include the accrual for the 1st and/or 2nd, calculated on Fridays CoB position.

Sat 1st
Business Day Amount DMO
Thurs 30th 40 2,739.72
Fri 31st 40 2,739.72
Sat 1st
Sun 2nd
Mon 3rd 40 8,219.16*


* Sat 1st 40 2,739.72
Sun 2nd 40 2,739.72
Mon 3rd 40 2,739.72
8,219.16


 
I've answered this in the Oracle 10 forum. Please don't post across multiple forums, as most people look at all Oracle forums anyway. It also causes confusion because we don't know which version of the DB you're using.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top