Query records that expire (date) in XX days

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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())
 
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())
 
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())
 
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
 
Back
Top