Discussion Locked

Access 97 Date Function

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

In a query, I want the criteria to limit the results to only those records with a date within the previous 30 days in this field.

I've tried <=Date()-30 and
<=(Date()-30) and
(DateDiff (d, (date()))<=30) which gave me an error message.

I know I could create a field to calculate the date that is always 30 days previous to today, then have my criteria say it must be greater than the calculated field. But surely there is a compact way to do it in one field.
Thanks for your help!

3 replies

by mbarker734

Drop the equal sign, the criteria area should look like:

>Date()-31

If you want the last 30 days.

Hope this helped,

Mark

by learneverything

Thanks. Boy was I making that harder than it had to be. If you are aware of a resource that lists functions in a more helpful way than what the expression builder does, I'd be tickled. THANKS.

This discussion is closed to new replies.