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 by text field in details section. 1

Status
Not open for further replies.

dragonturtle

Programmer
Sep 25, 2003
55
CA
Hi,

I have concatenated numbers into a string which serves as a field in my report. Crystal is sorting them like this:

2003-01
2003-02
2003-03
2003-10
2003-11
2003-12
2003-04
2003-05
...

I want those strings sorted from -01 to -12 in proper numerical order (even though it's a string). How would I go about this?

Thanks.

 
Don't even sort by the formula. If you are concatenating 2 numbers together than just sort by the first number (the one that returns 2003 in your example) and then by the second number (the set to the right of the hyphen).
This should give you the results you want.

~Brian
 
If this is an example of your actual display, these should sort correctly. Are you sure you are using this formula in report->sort?

-LB
 
Thanks for the quick replies. I couldn't sort by first number than second because I specifically needed the concatenated output.

Turns out I was grouping by first number instead of the formula. I'm an idiot.

Thanks again and Merry Xmas.
 
My solution won't work for because you are grouping on the value, which you didn't state initially.

lbass had the right idea from the get go, but you can sort by your first number, then your second number, and display your concatenated output. It will work.

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top