General discussion

Locked

MS Access Query by Date + Plus 30

By jgreer ·
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.

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

MS Access Query by Date + Plus 30

by DKlippert In reply to MS Access Query by Date + ...
Collapse -

MS Access Query by Date + Plus 30

by jgreer In reply to MS Access Query by Date + ...

Poster rated this answer

Collapse -

MS Access Query by Date + Plus 30

by mark.thomson In reply to MS Access Query by Date + ...

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.

Collapse -

MS Access Query by Date + Plus 30

by jgreer In reply to MS Access Query by Date + ...

Poster rated this answer

Collapse -

MS Access Query by Date + Plus 30

by SanKulPune In reply to MS Access Query by Date + ...

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.

Collapse -

MS Access Query by Date + Plus 30

by jgreer In reply to MS Access Query by Date + ...

Poster rated this answer

Collapse -

MS Access Query by Date + Plus 30

by jgreer In reply to MS Access Query by Date + ...

This question was closed by the author

Back to Web Development Forum
7 total posts (Page 1 of 1)  

Related Forums