DateAdd - 2 months from a [orderdate] field in an update query


G

Guest

I have produced an update query, and I now want to enter the criteria that
will search for all records that have an order date of more than 2 months or
60 days from the current day. I have not got a clue.

If you can help then it will be greatly appreciated
 
Ad

Advertisements

J

John Vinson

I have produced an update query, and I now want to enter the criteria that
will search for all records that have an order date of more than 2 months or
60 days from the current day. I have not got a clue.

If you can help then it will be greatly appreciated

To find all orders where OrderDate is older than 60 days ago use a
criterion of

< DateAdd("d", -60, Date())

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
G

Guest

John, great thank you very much. I take it < DateAdd("m", -2, Date()) would
also work?
 
D

Douglas J. Steele

DateAdd("m", -2, Date()) and DateAdd("d", -60, Date()) aren't exactly the
same thing.

The former will deduct 2 months, while the latter deducts 60 days. The only
time two months is equal to sixty days is for January and Febuary or Febuary
and March during leap years.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)
 
Ad

Advertisements

G

Guest

Cheers Dougles

Douglas J. Steele said:
DateAdd("m", -2, Date()) and DateAdd("d", -60, Date()) aren't exactly the
same thing.

The former will deduct 2 months, while the latter deducts 60 days. The only
time two months is equal to sixty days is for January and Febuary or Febuary
and March during leap years.
 

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