Date Parameters

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I need to filter records in a Query based on todays date. The records
need to be not older than 8 days from todays date. So it should include
all records that are within 8 days of todays date. I tried this but it
doesn't work.
<DateAdd("d",-8,Date())
Thanks
DS
 
For the criteria in your date field (hopefully, not called "date") enter the
following in the query design grid:
=Date()-8

If there are records that have dates after today's date, you'll need to
filter them out as well. That will change the above to:
=Date()-8 And <=Date()

If there are times (time of day) in the dates also, this will need to be
modified further:
=Date()-8 And <Date()+1

The last one could be used whether times are included or not.
 
Wayne said:
For the criteria in your date field (hopefully, not called "date") enter the
following in the query design grid:




If there are records that have dates after today's date, you'll need to
filter them out as well. That will change the above to:




If there are times (time of day) in the dates also, this will need to be
modified further:




The last one could be used whether times are included or not.
Thanks. =Date()-8 And <=Date() worked.
DS
 
Back
Top