Subtract 1 month from a date

ECEK

Registered User.
Local time
Today, 17:35
Joined
Dec 19, 2012
Messages
717
My [datefield1] is formatted as dd/mm/yyyy
I wish to create a query that produces a return of the previous month and year.
ie.
25/03/2015 (though a query formula) becomes Feb-15
01/01/2000 would return DEC-99
etc

This way I can then link all of my February data (formatted "mmm-yy" to my [datefield1]

I have tried subtracting day and formatting to months and subtracting then the value of a month but it all becomes too complicated because of the different days in the months and Jan to Dec and year as well.

any thoughts?
 
Solved it:

DateAdd("m",-1,[datefield1])

...then just format the result to "mmm-yy"
 
Last edited:

Users who are viewing this thread

Back
Top Bottom