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!

first day of the next month

Status
Not open for further replies.

2bulent2

Technical User
Jan 7, 2009
24
TR
hello

i need to print the first day of the next month in a report

today is 10.08.2009(d.m.y)
it will write 01.09.2009 automatically
?
 
Start by getting the first of this month, then use DateAdd to add one month to that date:
Code:
todaysDate = date()
firstThis = dateserial(year(todaysDate), month(todaysDate), 1)
firstNext = dateadd("m", 1, firstThis)

Geoff Franklin
 
=DateSerial(Year(Date()),1+Month(Date()),1)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Code:
=DateSerial(Year(Date()),1+Month(Date()),1)

Very neat. At first I though that this would fail at 31st December but, after a little testing, I now know that DateSerial() will accept a month of 13 and will increment the year.

Geoff Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top