Query records that expire (date) in XX days

G

Guest

I have a table that holds a field called "Expiration Date." On the query, how
can I get a pop up that prompts the user to enter the number of days left
before the date equals today's date? For example, we want to see all the
records that will expire within 60 days. How exactly do I get this?
 
F

fredg

I have a table that holds a field called "Expiration Date." On the query, how
can I get a pop up that prompts the user to enter the number of days left
before the date equals today's date? For example, we want to see all the
records that will expire within 60 days. How exactly do I get this?

As criteria on the ExpirationDate field:
Between Date() and Date() + 60

or you can use ...
Between Date() and DateAdd("d",60,Date())
 
J

John Spencer

If you want the user to be able to enter a variable number of days, you can
modify that to

As criteria on the ExpirationDate field:
Between Date() and DateAdd("d",[Enter Number of Days to Expiration],Date())
 
G

Guest

Thanks for the replies!

John Spencer said:
If you want the user to be able to enter a variable number of days, you can
modify that to

As criteria on the ExpirationDate field:
Between Date() and DateAdd("d",[Enter Number of Days to Expiration],Date())
 
T

Todd

I am trying about the same thing here, but when I put anything into the
criteria, I get a popup with one of the names from a field that I use in the
query. If I put anything or nothing into the popup, I get no records
returned when I run the query.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top