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!

First day of the month following a date

Status
Not open for further replies.

Extrmdressage

Technical User
Sep 24, 2009
12
US
I need a formula for Crystal for the first of the month following a date. For example, if a date is 12/27/09, the formula would need to return 01/01/10. I have tried several formulas, but keep getting errors. Any assistance would be appreciated. Thanks in advance.
 
if month({@date}) = 12 then
date(year({@date})+1,1,1)
else
date(year({@date}),month({@date})+1,1)

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
Or, you could use:

dateserial(year({table.date}), month({table.date})+1, 1)

-LB
 
lbass solution is better .... I tried to do that with date() but got an error obviously...

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top