query for items more than 90 days from current date

  • Thread starter Thread starter Guy Story
  • Start date Start date
G

Guy Story

I am striking out on this one. I need to be able to run a query that looks
for items that exceed 90 days from the current date. I thought Day()-90
would do the trick but it did not. The opposite of DateAdd is what I am
looking for, I think. Any suggestions?


Guy.


..
 
Well, the opposite of dateAdd is DateAdd, but using a negative number as the
amount to add

DateAdd("d",-90,Date())

Should return a date that is 90 days prior to today's date. Also, your idea
should work for days, but you need to use the Date() function.

Date()-90 will also return the date 90 days prior to today's date, although to
be safe I would force the data type by using a CDate function or by declaring
the parameter type in my query.

CDate(Date()-90)
 
Back
Top