Date criteria for a query

J

John W. Vinson

To include all records from 2 Months back, not 60 Days,Thanks for any
help..Bob

Does that mean...

all records with a datefield between June 20 and August 20?

or

all records with a datefield between July 1 and August 20?

or

all records with a datefield between June 1 and August 20?

or

all records with a datefield between June 1 and July 31?

Any of these could be interpreted as "two months back". Which do YOU mean - or
do you mean something else?
 
R

Rick Brandt

Bob said:
To include all records from 2 Months back, not 60 Days,Thanks for
any help..Bob

SELECT ...
FROM TableName
WHERE DateField >= DateSerial(Year(Date()), Month(Date())-2, 1)
 
J

John W. Vinson

Please answer the questions as posted, Bob. "the very first date" is still
ambiguous. The first date two months ago from today (6/20) or the first date
of the month two months ago (6/1)? What's the end date?

My telepathy is a bit on the blink today I fear.
Sorry 2 months back till the very first date.....Thanks Bob
 
B

Bob Vance

Ok Sorry Now() back 2 Months all records back from there
i.e. Today Aug 21 (8thMonth) all records from June (6th Month) back
Thanks Bob

John W. Vinson said:
Please answer the questions as posted, Bob. "the very first date" is still
ambiguous. The first date two months ago from today (6/20) or the first
date
of the month two months ago (6/1)? What's the end date?

My telepathy is a bit on the blink today I fear.
 
B

Bob Vance

Overdue2: DateDiff("m",[BillDate],Now()) with the Criteria >2
Seems to work?,,,Bob

Bob Vance said:
Ok Sorry Now() back 2 Months all records back from there
i.e. Today Aug 21 (8thMonth) all records from June (6th Month) back
Thanks Bob
 
Top