Retrieving one months data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to extract one months worth of data from my table.
This statement gives me all the data the last 6 months:
Between DateSerial(DatePart("yyyy",Date()),DatePart("m",Date())-6,1) And
Date()-(DatePart("d",Date()))

What I actually want is for just the 6th month ago - that is data just for
Feb if it is August now, data just for last October if it is now April.

Any ideas?
 
Try this --
Between DateAdd("m",-6,Date()-Day(Date()))+1 And
DateAdd("m",1,DateAdd("m",-6,Date()-Day(Date()))+1)-1
 
Back
Top