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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

financial year...

Status
Not open for further replies.

abhi900

IS-IT--Management
Jul 1, 2010
117
AU
hi,
I have the following logic that needs to be implemented at universe level

the filter for timesheet data should be based on timesheetperiod_full.enddate so IF timesheetperiod_full.enddate >30/6/2012(begning of financial year) THEN (if day of week > wednesday then timesheetperiod_full.enddate set to WEDNESDAY of current week) else timesheetperiod_full.enddate IN (previous week which will be "Friday")).

I have created a logic to check the day from currentdate and then deduct no.of days accordingly to either set to WEDNESDAY(current week) or FRIDAY(of last week) ONLY.

Select CASE DATEPART(DW, GETDATE())
WHEN 1 THEN DATENAME(DW, DATEADD(DAY, -4, GETDATE()))
WHEN 2 THEN DATENAME(DW, DATEADD(DAY, -3, GETDATE()))
WHEN 3 THEN DATENAME(DW, DATEADD(DAY, -4, GETDATE()))
WHEN 4 THEN DATENAME(DW, DATEADD(DAY, -5, GETDATE()))
WHEN 5 THEN DATENAME(DW, DATEADD(DAY, -1, GETDATE()))
WHEN 6 THEN DATENAME(DW, DATEADD(DAY, -2, GETDATE()))
WHEN 7 THEN DATENAME(DW, DATEADD(DAY, -3, GETDATE()))
END

How can I use the above logic to incorporate in what I am asking above.

I need this DIM to act as a FILTER for the record selection to be based on.

Using SQL / IDT 4.0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top