Query records that expire (date) in XX days

4

4saken

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())
 
4

4saken

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
 
S

smartin

Todd said:
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

What is the name of the field in the popup? Is it a reserved word, or
are you using "Date" (a reserved word) as a field name somewhere?
 
Top