Skip to content

Creating a Date Range Filter

How to create a date range filter.

Q:  Fredm writes:  “I have a table that has two different date fields but I have linked them to one date table.  I want to filter the results of the date to show records from now to 30 days before but find that the usual expressions to filter the date don’t work. I have created a query and just used the date table and used both date()-31 and Now()-31 but will only get the NOW() result. Can you advise me on where I may be going wrong?”

A:  In order to define a date range to filter a query for the previous 30 days through today, you need to use one of the expressions below:

Between Date() – 30 And Date()

 

>= Date() – 30 And <= Date()
 

Otherwise you will just get a match to a single date 30 days in the past.

About this author

Office 2024 - all you need to know. Facts & prices for the new Microsoft Office. Do you need it?

Microsoft Office upcoming support end date checklist.