Query for rows with a field date in this week?

  • Thread starter Thread starter Lu An De
  • Start date Start date
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'.
 
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")));
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top