DateSerial function - criteria in query

  • Thread starter ironwood9 via AccessMonster.com
  • Start date
I

ironwood9 via AccessMonster.com

I have a query that I have set up to return a date range of BETWEEN 6/11/09
and 7/10/09 - this query is run early in the month, in this case july.

Next month, around the 10th of August, I will have to go in and change to
7/11/09 and 8/10/09 - is there a way I can just have it say basically BETWEEN
THE 11TH OF LAST MONTH AND THE 10TH OF THE CURRENT MONTH ?
 
J

John Spencer

Between DateSerial(Year(Date()), Month(Date())-1,11) and
DateSerial(Year(Date()),Month(Date()),10)


Or if you want to wait until the 10th of the month to do the switch, you
might try the following UNTESTED statement.

Between DateSerial(Year(Date()), Month(Date())-1 + Day(Date())<11 ,11)
and DateSerial(Year(Date()),Month(Date()) + Day(Date())<11,10)

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top