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!

Number format in a "Text" & (number) formula? 1

Status
Not open for further replies.

Spenney

Technical User
Apr 11, 2003
93
GB
Completely new to Crystal Reporting...

I had a formula field to count incidents for a given section
Code:
Count({incident.incident_ref}, {serv_dept.serv_dept_n})
This worked as I would expect and as the result will always be an integer, it was formatted to display without any decimal places.

I then edited the formula to make it more descriptive like so...
Code:
"Count of incidents logged by members of the " & {serv_dept.serv_dept_n} & " SVD: " & Count({incident.incident_ref}, {serv_dept.serv_dept_n})
The result is fine except for always displaying '.00' after the integer.

Please can anyone advise me on how to format the number within the formula or any other method of suppressing the trailing decimals?

Thanks very much
 
Use:

"Count of incidents logged by members of the " & {serv_dept.serv_dept_n} & " SVD: " & totext(Count({incident.incident_ref}, {serv_dept.serv_dept_n}),0)

You could also instead use a text box, where you add the text and then drag the field and summary into it.

-LB
 
Thanks very much - exactly what I needed.

Just what I thought it should be except I didn't discover the 'totext' function in my searches of help. I had tried 'Format' which seemed logical to me!?

Anyway, thanks for the very quick response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top