I am trying to run a report that will only return results between the previous day and the first day of the week. I have tried accomplishing this a couple of different ways, and so far have been unsuccessful. I have code that works with Access (listed below) but I am trying to run the query without Access. Here is what I have thus far.
--This does not work
DB1.TB1.DATE_ID Between (current day-1 day) And current day='MONDAY'
--This will work in Access
DB1.TB1.DATE_ID=201302) AND ((Weekday([DATE_ID])) Between 2 And Weekday(Date()-1)))
Any help I can get would be greatly appreciated.
You can make use of DAYOFWEEK function which returns an integer value for days i.e. 1 for Sunday and 7 for Saturday.
so
DAYOFWEEK(CURRENT DATE) - 1 DAYSwill return number of days which can be subtracted from current day to get the Monday of current week.Here is the exact statement: