Find records where a date is less than 120 days

G

Guest

Hello,

I am trying to create a query where I can get all records that are 120 days
past a date. I tried running a query where the date criteria for a
DateReceived is:

date()<120

But that did not work. Does anyone have a suggestion?

Thanks,
Lisa
 
D

Douglas J. Steele

Your criteria should be < date() + 120.

That will return all records where DateReceived is at least 120 days before
today.
 
V

Van T. Dinh

If you want Records whose ReceivedDate is more than 120 days old, i.e.
w.r.t. today, then use:

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

in the criteria row of the "DateReceived" Column.
 
J

John Vinson

Hello,

I am trying to create a query where I can get all records that are 120 days
past a date. I tried running a query where the date criteria for a
DateReceived is:

date()<120

But that did not work. Does anyone have a suggestion?

This will find all records where the date field is equal to December
30, 1899, and I doubt you have any such! The reason is that the
expression

Date() < 120

is a FALSE expression; 120 corresponds to a Date/Time value of April
20, 1900. FALSE is expressed as the number 0 (True is -1) so the
criterion becomes the date corresponding to 0, which is #12/30/1899#.

Try a criterion of

<= DateAdd("d", -120, Date())

on DateReceived.

John W. Vinson[MVP]
 

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