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

Sorting/Grouping numeric text

Status
Not open for further replies.

tutuster

Programmer
Feb 2, 2005
41
0
0
FI
I need to sort records using string typed value, as the first group (main category) is a string (1-99), the grouping/sorting is done alphabetically (for example 1,10,2,3,4,5,6,7,8,9)

I need to sort the data in ascending order, numeric of course.

This issue is related to my previous post (
and i have been looking into posts
and

but i'm a bit lost here. Please notice im new to CR, the version is 8.5

The solution is to group the data via formula? How is that done exactly?

Great thanks for replies,
Tus
 
Try modifying the number-to-text, e.g.
Code:
ToText({your.number}, "00")
This will produce 01, 02 etc and 10 will sort after 02.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thx for the reply,
As said, the value is alredy as string format. I tried your suggestion, but it leads to the same result, only format changes 001,010,002,003... etc.

I need to find a way to trick this report now :)
 
All you need to do is use:

val({table.string})

Use this as your sort field or group on it in descending order. You can still display your original field on the report.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top