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!

Using DatePart or DateAdd functions

Status
Not open for further replies.

AnthonyJ20

Programmer
Aug 24, 2005
32
US
Hello, I have a question. Can either the DatePart or DateAdd functions be used to automatically get the first day of a previous month? For example, when the month rolls over from one to the next, as in the case of September to October, how can either of these functions be used to present the first day of September or whatever the previous month might be? Any thoughts or examples?
 
get the first day of a previous month
DateSerial(Year(Date()), Month(Date()) - 1, 1)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
It sure did!! Thanks, that's just what I was looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top