Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working with dates in Access

Status
Not open for further replies.

benu302000

Programmer
Aug 11, 2004
23
0
0
US
I am trying to implement a form that will allow a user to search for records that are about to expire (VIA a date field marked "expiration date") through a form that allows them to enter the number of days from the current date to check for records about to expire. For instance, if the user enters the number 30 into the text box, the form should ideally return all records that are due to expire in the next 30 days.

This means I need access to the current system date through access, as well as any useful, quick-and-painless objects or methods that might exist code-wise for working with, and calculating dates. If there are any such objects or methods for the use of making dates easier to work with, I'd be much apppriciative of what they are, or how they work, or a reference to a resource that will tell me. Thanks in advance, you wonderful guys and gals are the only reason this project has advanced so far already.
 
The criteria may be something like this:
"[expiration date] Between Date() And Date()+" & Forms![Name of main form]![Name of textbox]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Can you you the add operator like that with dates?
 
A date is a number of days.
You may also take a look at the DateAdd function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top