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

Forcing a sort 2

Status
Not open for further replies.

RiverGuy

Programmer
Jul 18, 2002
5,011
US
A have a question for you Crystal experts out there. What would be the best way to force a sort order? I have a group sort, but it does not make sense to sort alphabetically. The field text is a formula field. But it does not make sense to group it alphabetically because it has to do with numbers. So basically I would like to define my out sort order.

Is this possible?

Thanks.
 
Create a formula based on the numeric equivalent of the field and use this to group/sort.

val({MyTable.MyField})

You can then display the database field, and it will be sorted numerically, but showing the alpha version in case you have leading zeroes in the database.

Hence:

1
12
101
2

will group and sort as:

1
2
12
101

-k kai@informeddatadecisions.com
 
With groups you can also use the 'specified order' feature instead of ascending. This lets you decide the order of each item. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
OK. I will try the 'specified order'. I can't do the numeric equivalent because there is text in the fiels too. For example 'Between', or 'Less than'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top