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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get first day of previous month in Access

Status
Not open for further replies.

MikeDamone

Programmer
Oct 21, 2003
106
US
I'm looking for a way to return the first day of the previous month in Access without the time

So if today is 7/1/2010, I'm looking to return 6/1/2010. Does anyone know how to do this? Thanks!!
 
Use DateDiff - there are many examples on this site, including thread701-1184170

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
DateDiff was the incorrect answer. I meant DateAdd, but the DateSerial answer is much simpler than what I was thinking. It even automatically returns 12/01/2009 for any date in January 2010.

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Yeah, dateserial tolerates out-of-range values for month and day and adjusts appropriately. Quite useful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top