cancel
Showing results for 
Search instead for 
Did you mean: 

Sort in ascending order as number in Group Expert

former_member533461
Participant
0 Kudos


Hi there,

I need some help.. We have a crystal report which contains a group called Number. The database input field is coming as a string [5] but we want to print this field in ascending order. However, 11 is printed between 1 and 2 as it is a sting field.

Is there any way to convert into Number type?

Crystal Report Preview Window

Thank you in advance.

Chrissa

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

Try using this formula:

If NumericText({Number field}) then ToNumber({Number field}) else 0

This will prevent errors by checking to see whether the field is actually a number prior to converting it.

-Dell

former_member533461
Participant
0 Kudos

Hi Dell Stinnett-Christy,

Thank you for your prompt response. May I know where this formula is supposed to be? In Group Expert >> Common tab >> Use a formula as Group Sort Order?

DellSC
Active Contributor
0 Kudos

No.  Add it as a formula in the Field Explorer and then group on the formula instead of the field.

-Dell

former_member533461
Participant
0 Kudos

Thank you, I will try!

former_member533461
Participant
0 Kudos

It worked. Thank you so much for your help!!

Answers (0)