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

Sorting a String Numerically

Status
Not open for further replies.

jwrjwr54

Technical User
Apr 21, 2003
41
US
I have a formula that concatenates {project.number} &'-'& {project.name} (both are string fields). I need to sort the group in numerical order.

100151-Project A
109833-Project DD
45678-Project ABC
67443-Project AA

If I group on tonumber({project.number}), I can sort numerically, and format to remove commas and decimals in a regular report, but this formula is in a crosstab.
Thanks
 
If you want numerical strings to sort correctly you must pad with leading zeros

eg
109833-Project DD
045678-Project ABC

Change your concatenation formula

totext({project.number}, "000000",0,"") &'-'& {project.name}

Ian
 
I think Ian meant:

totext({project.number}, "000000") &'-'& {project.name}

You could use this for your crosstab field, but then use the customize name option to display your original concatenation formula if you like.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top