Using dates in querys - access 2003

M

mariee4

how do i create a query that shows the fields which have a date before three
months prior to todays date.
 
J

Joe Blow

A quick easy "criteria" would be: <=Date()-90

But if you want actual months, as in this is April, and you want January,
you may need to write code in a module that breaks up the dates into
month-day-year.
And choose <=Month-3.

Hope this helps a little...
 
D

Damian S

Hi mariee4,

Try something like this:

select * from TABLENAME where DATEFIELD < (dateadd("M", -3, date()))

The dateadd function is adding a negative 3 months to today's date... ie:
subtracting 3 months.

Hope this helps.

Damian.
 
I

i_takeuti

Joe Blow said:
A quick easy "criteria" would be: <=Date()-90

But if you want actual months, as in this is April, and you want January,
you may need to write code in a module that breaks up the dates into
month-day-year.
And choose <=Month-3.

Hope this helps a little...
 
Top