16th of Last Month to 15th of This Month...

  • Thread starter Thread starter ABAX
  • Start date Start date
A

ABAX

Hey all ....

I have a query where I would like remove the parameter prompt and
automatically obtain records between the 16th of last month and the 15th of
this month. Can't figure out if it's DateAdd, DateSerial, etc. Any help
would be greatly appreciated. Thanks in advance.

- ABAX
 
Try
Between DatePart("m",Date())-1 & "/16/" & DatePart("yyyy",Date()) And
DatePart("m",Date()) & "/15/" & DatePart("yyyy",Date())
 
I would use dateSerial function.

Where SomeDateField >= DateSerial(Year(Date()),Month(Date())-1,16) and
SomeField < DateSerial(Year(Date()), Month(Date()),16)

IF your datefield doesn't contain a time, then you could use
Between DateSerial(Year(Date()),Month(Date())-1,16) and
DateSerial(Year(Date()), Month(Date()),15)
 
To treat the first 15 days of a month as if they belonged to the previous
month, type this expression in the Field row in query design:
DateAdd("d", -15, [YourDateField])

You can then group on this calculated field in your report, or query, or
whatever.
 
Back
Top