Date expressions

  • Thread starter Thread starter Sally Shermer
  • Start date Start date
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
 
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:
 
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
 
Back
Top