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

Numbers converted to string are in 0,000.00 format 1

Status
Not open for further replies.

ESquared

Programmer
Dec 23, 2003
6,129
US
My second day using Crystal Reports. (Forgive me if my questions are lame!)

Created a formula to use on my report

formula = Choose((Month({WeeklyMapping;1.ReportDate})-1)\3+1,"1st","2nd","3rd","4th") & " Quarter " & Year({WeeklyMapping;1.ReportDate})

But this gives "2nd Quarter 2,004.00" instead of "2nd Quarter 2004" which is what I want.

I've tried Format({WeeklyMapping;1.ReportDate},"yyyy") but it doesn't like that.

Any ideas? I appreciate your help.

-------------------------------------
A sacrifice is harder when no one knows you've made it.
 
You can use the ToText function

formula = Choose((Month({WeeklyMapping;1.ReportDate})-1)\3+1,"1st","2nd","3rd","4th") & " Quarter " & ToText({WeeklyMapping;1.ReportDate},0,"")

~Brian
 
I tried CStr, which is identical to ToText, but I didn't know about the extra parameters to specify formatting. I'll keep that in mind when I use familiar VB functions in the future and look in the help to see if additional parameters exist.

Thanks!

I used:

formula = Choose((Month({WeeklyMapping;1.ReportDate})-1)\3+1,"1st","2nd","3rd","4th") & " Quarter " & CStr({WeeklyMapping;1.ReportDate},"yyyy")

-------------------------------------
A sacrifice is harder when no one knows you've made it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top