Using dates in querys - access 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how do i create a query that shows the fields which have a date before three
months prior to todays date.
 
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...
 
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.
 
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...
 

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

Back
Top