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!

Report runs in Crystal 11, but fails in Enterprise

Status
Not open for further replies.

celauritz

Technical User
Dec 2, 2005
41
US
I have a field that shows the date as such:

20100901

I have written this formula to build the date:

date(tonumber(left(totext({date}),4)),tonumber(mid(totext({date}),5,2)),tonumber(right(totext({date}),2)))

I use the formula in the select expert to pull @Date in LastFullMonth. When I run the report in Crystal, it works just fine, but when I run it through Enterprise, I get this error:

Error in formula <Date>. 'if {PHUSGOUT.MOCHGD} = 0 then today else ' A month number must be between 1 and 12. Details: errorKind

Any ideas?

I have tried to do when {date} = 0 then today else [formula above], but that doesn't work either. There are no NULL values either.
 
If the field is a number, try formatting it like this:

date(tonumber(left(totext({date},0,""),4)),tonumber(mid(totext({date},0,""),5,2)),tonumber(right(totext({date},0,""),2)))

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top