cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting numbers in Crystal Reports 10

Former Member
0 Kudos

I have a field that was originally in a string format, but I converted it to a number.

I have values ranging from 7000 to 10000.

I want to sort in either ascending or descending order it doesn't matter.

The results I get are not what I want. It either sorts it one of the following orders.

10000

7000

8000

9000

or

9000

8000

7000

10000

I want it to do the following:

7000

8000

9000

10000

or

10000

9000

8000

7000

Any ideas how to make it sort it correctly?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

have you used them in a group? or as a group? because when you use them as a group it gives you the facility to use it as ascending or descending.

Alternatively, check what other fields which might be related to this might be causing the inappropriate sorting of this field.

Try placing the only "number" field on an empty report and then use ascending order and see if that works. If it does then something else is causing the issue. If however it does not then it must be something I don't know about.

Have you tried Record Sort from "Report--->Record Sort" and put the field in it and see if that sorts the record?

Regards

Jehanzeb

Former Member
0 Kudos

I can sort it, it just doesn't sort it the way that I perceive to be ascending or descending.

former_member260594
Active Contributor
0 Kudos

Christian,

It appears to be sorting a string field still, try creating a formula that converts the string to a number using the tonumber function and sort on the formula.

Former Member
0 Kudos

Graham,

Thanks for your help, I had created a formula that changed it to a number and then was using the formula in my report.

However, when i sorted the report I did it on the string attribute instead of on the number formula.

Answers (0)