Quote:
|
Originally Posted by stolze
To get the monday of the current week, you take the current date, apply the DAYOFWEEK() function to it and then substract this number of days from CURRENT DATE again:
Code:
VALUES CURRENT DATE - ( DAYOFWEEK(CURRENT DATE) - 1 ) DAYS
Throw in a CASE expression for handling the special case of executing the query on a Monday, and off you go. The rest is straight-forward SQL.
|
CURRENT DATE - ( DAYOFWEEK(CURRENT DATE) - 2 ) DAYS is giving me Monday of current week. How to get MON-FRI of last week ??
I am going to use this query in Business Objects. User enters their required date in a Prompt. If they enter Monday's date (any month) it should provide them the Claim count for last MON, TUE, WED, THU, FRI group by each Day. If they Enter date other than Monday, it should provide them the current weeks data except their entered date's data. For Ex: If they Enter Thursday Sep 04 2008, it should give results like this
Mon Tue Wed
13 2 89