Date expressions

S

Sally Shermer

Hi,

I am relatively new to Access and greatly enjoy readin the articles in
this group. I am having trouble figuring out a couple of date expressions.
I would like to have an expression in a query on a date field that returns
records n days in the past. Then in another query I would like an
expression that returns records showing any future date. Both would always
be based on the current system date.

Any help you could give would be greatly appreciated!

Sally
 
P

PC Datasheet

To get records n days in past, add this calculated field to your query:
DaysInPast:Date()-NameOfYourDateField
Then if you want a single day in the past, put this in the criteria of that
field:
[Enter Number Of Days In Past]
or if you want the records prior to a certain number of days, use this criteria:
[Enter number of Days In Past]

For the future date, put this in the criteria of your date field:
 
S

Sally Shermer

To get records n days in past, add this calculated field to your query:
DaysInPast:Date()-NameOfYourDateField
Then if you want a single day in the past, put this in the criteria of that
field:
[Enter Number Of Days In Past]
or if you want the records prior to a certain number of days, use this criteria:
[Enter number of Days In Past]

For the future date, put this in the criteria of your date field:

Outstanding - thanks for your help!

Sally
 

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