Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use between dateserial to

Status
Not open for further replies.

zclv05

Programmer
May 14, 2003
6
US
How can I use between dateserial to give me the first day of the previous month and last day of previos month.

eg. between #4/1/2003# and #4/30/2003#

The code I used is:
Between DateSerial(Year(Date()),Month(Date()-1),1) And DateSerial(Year(Date()),Month(Date()-1)+1,0)

I am getting back current data from 5/01/2003 - 5/14/2003

Thanks for the help,
 
Error MUST be between the seat and Keyboard (perhaps eyes are involoved in nefarious actions as well)? The statement is in general o.k. for dates where Jan is not a factor. For those, you need to be careful of the year crossover.



MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top