Date <>

brin

Registered User.
Local time
Today, 16:11
Joined
Nov 14, 2001
Messages
41
I have a querie with a date field, i would like to run a report where i insert a random number e.g 5 and the qurie shows me results 5 days ago. I know the fucntion , start and end but is there a function where i can enter the amount of days??
 
This should be pretty easy in the criteria field(s) of your query. All you have to do is include an unbound (non-existant) field in your expression.

For example:
If you want to run a query that shows records that expire in the next (X) days, you would create a query with the appropriate date field, and in the criteria area for that date field, you would type:

< (Date() + [Enter Number of Days])

When you run the query, Access will NOT recognize "[Enter Number of Days]", so a pop up dialog box will show up Saying "Enter Number of Days"

If you type in 5, the criteria that the query will use is:
< (Date() + 5)

Which is all records with dates prior to (less than) 5 Days from TODAY.

You can, of course modify the rest of the expression for your specific needs (i.e. to deal with days ago, dates between a range, etc.)

- Glynn
 

Users who are viewing this thread

Back
Top Bottom