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!

Convert Numbers to text in Select Expert

Status
Not open for further replies.

timmahan

Technical User
Apr 23, 2007
18
US
Using Crystal Reports 10, with data from Access or MySQL, The Report is a Zip Code report, with the zip field as the Group.

The Data has the zip formated as a number. I have formated it in Crystal as -1123 (no comma and no decimals)This works fine in the body, except in the left drill down panel where they still show with a comma 9,0503

I have searched the forum all day and tried many variations of toText, but continue to get errors, usually "result of selection formula must be Boolean"

I want to change the zip code to text (globally) so it appears as 90503 everywhere, Can anyone assist ?
 
A selection formula mus evaluate to true or false, then the record either will or will not get selected for the report. So the selection formula is the wrong place to do this, you should create a formula field.

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

"What version of URGENT!!! are you using?
 
Thank you for your response. Perhaps I didn't state my question clearly. The real problem was not just creating formula it was how to use it to format the field in a Group

It did figure it out, however. In Group Expert Options, after creating the Group, I select "Use formula as a group" and put the formula, ToText({sales.zip},0,"")there
 
If the zip is a number, it would not show leading zeros, so I think you would be better off formatting it like this:

totext({sales.zip},"00000")

This assumes a 5-digit zip.

-LB
 
I believe if you create a formula field for the zip - as previously stated - and use THAT field as the field on which the group is based - THEN the drill down will show the formatted version of the zip field in the drill down.

i'm running CR8 and it appears to work as such

totext({zip},0,'') works for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top