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

Date format in formula 2

Status
Not open for further replies.

HezMac

Programmer
Joined
Jan 14, 2004
Messages
56
Location
CA
Hi

I would like a column heading to read: April - 2005

Where the year is dependant on the parameter entered.

I'm using the following formula:
Code:
If month({?StartDate}) in 4 to 12 then
   'April - ' & Year({?StartDate})
Else If month({?StartDate}) in 1 to 3 then
    'April - ' & Year({?StartDate}) -1

And getting a result of 'April - 2,005.00

I'm using CR 8.5 - do you know how I can format the number to be '2005'

Thanks
 
Try this:

'April - ' & totext(Year({?StartDate}),0,"")

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Try this

Code:
If month({?StartDate}) in 4 to 12 then
   'April - ' & totext(Year({?StartDate}))
Else If month({?StartDate}) in 1 to 3 then
    'April - ' & totext(Year({?StartDate}) -1)
 
Thanks, dgillz!
That worked!
What is that '0, "") ' anyway?
 
0 = # of decimals
"" is the thousands separator

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top