how can calcut and return in date 7 monthe from any date

M

mah

i want show automatic last 7month in date

like this sample i want show last 7 monthe i can
if we are in 30/12/2004 show
11/2004 10/2004 09/2004 8/2004 7/2004 6/2004 5/2004
 
D

Douglas J. Steele

WHERE MyDateField >= DateDiff("m", -8, DateSerial(Year(Date()),
Month(Date())+1, 1))

DateSerial(Year(Date()), Month(Date())+1, 0) returns the first day of the
next month. For a date in December, that means it'll return 1 Jan, 2005. The
DateDiff expression will return the first day of the month 8 months prior to
the first day of the next month, so 1 May, 2004.
 
Top