Last 12 months of data.

ddbrook

Registered User.
Local time
Today, 08:06
Joined
Oct 29, 2002
Messages
10
I have a date field[trans_date] this has multiple months in the field...I need to pull the last 12 months of data in my query.

Data looks like this:

Acct#,trans_date,trans_amt,journ#.
1234,10/4/02,5900.29,24

I need to take the current month and minus 12 months.

Thanks for your help.

DDBROOK
 
in the criteria under the date field:

>=DateAdd('m',-12,Date())

if you need to go back to the first day of that month, then:

>=CDate(DatePart('m',Date()) & "/01/" & DatePart('yyyy',Date())-1)
 
Last edited:
Try This:

SELECT *
FROM [Table1]
WHERE trans_date>=DateAdd("m",-12,Date());
 
Great thanks for the help again...

ddbrook
 

Users who are viewing this thread

Back
Top Bottom