Query returning previous week's values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to return all information from a table having a field called "service_date"

However, the data should be only from the previous week, from Monday to Saturday.

Lets say we have multiple entries for last Monday, Tuesday....Saturday where the "service_date" would be 12/22/2003, 12/23/2003... 12/27/2003 respectively

I want to extract all the related information from these entries on lets say a Wednesday, 12/31/2003

How can this be done?
 
I would try the following:

Field: Service_Date
Criteria: Between DateAdd("d",-WeekDay(Date()),Date())-5 And DateAdd("d",-WeekDay(Date()),Date())

In an SQL statement that would be

SELECT ...
FROM TableName
WHERE Service_Date Between DateAdd("d",-WeekDay(Date()),Date())-5
And DateAdd("d",-WeekDay(Date()),Date())
 
Back
Top