Query for rows with a field date in this week?

L

Lu An De

Hi All,

I've put a date field on a form called 'Call Back Date' which informs me
when I should be making a follow-up call to a client. I would like to make a
query or report that returns all the records where the call back date ( if
present) falls 'this week'.
 
W

Wayne Morgan

Create the query to return the desired data except for the week filter.
Next, add an extra field to filter the date. Uncheck the "Show" box for this
field, since it probably won't need to be output, it just needs to filter
the dates for you. In the example below, I used to Format function to get
the week and year of the date and compare it to today's week and year.

Example:
SELECT Table2.Field2
FROM Table2
WHERE (((Format([Field2],"wwyyyy"))=Format(Date(),"wwyyyy")));
 
S

Steve Huff

Without putting a lot of thought into this here is a simple query solution:

SELECT Table1.*
FROM Table1
WHERE (((Table1.CallBackDate) Between Date() And DateAdd("d",Date(),5)));

This will give you the records that fall between today and the next 5 days
so if ran on Monday would give you that day through Friday.

-Steve Huff
 
Top