Show last month's results

steve711

Registered User.
Local time
Today, 01:20
Joined
Mar 25, 2004
Messages
166
Hello All,

I am having problems getting the following lines to do what I need exactly. The formatting is kicking my butt basically.

Bob helped with these lines but I actually need the result to be last month. For instance it is now Jan. 07 and I need the query to total up the hours flown for Dec. 06. On Feb 1 07 I need it to now display Jan 07 totals and so on.

Query Field:
Format$([tblEntry].[tblDate],'mmmm yyyy')

Criteria:
Format(date(),"mmmm yyyy")

How can I change this to do what I stated above?
 
Try this:

Criteria:
Format(DateSerial(Year(Date), Month(Date) - 1, 1), "mmmm yyyy")
 
Or

Format(DateAdd("m",-1,Date()),"mmmm yyyy")

Brian
 
Thanks fellas. I can always count on this forum to help me through. Both suggestions worked just fine, BTW.

I went with the DateAdd since this was the line I was taking before I came to you all.
 

Users who are viewing this thread

Back
Top Bottom