Discussion Locked

MS Access Query by Date + Plus 30

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
What expression do I enter into an MS Access Query that would poll todays date and search for records due within 30 days of today? Example: When I run this query I want it to display all records that expire 30 days from today.

7 replies

by mark.thomson

SELECT * FROM Expirytable WHERE
INT(ExpiryDate) = (Date() + 30)

The reason for the INT() round the ExpiryDate is that Access stores dates as a double precision floating point number where the decimal part indicates the time (.0 = 00:00:00 etc.). If any of your expiry dates has a non-zero time then a comparison without the int() would fail.

by sankulpune

Hello jgreer,

I am assuming that you already have a query that lists all the records and you want only to modify this query.

1) Open the query in design view.
2) In the 'Criteria' row of the field that contains the date, type the following:
Between Date() And Date()+30

Close (and save) the query.

Opening the query will display all the records that have date in the specified range (both dates included).

Your feedback, as to whether this helped or more assistance is needed, would be highly appreciated.
I would be glad to provide any more specific assistance you may need in this regard.

With best compliments,

SanganakSakha,
Simple And Effective Solutions To Small Problems, No QuickFixes.

This discussion is closed to new replies.