Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Group Sorting Post Reply Post New Topic
Author Message
gemcka
Newbie
Newbie


Joined: 02 Aug 2011
Online Status: Offline
Posts: 16
Quote gemcka Replybullet Topic: Group Sorting
     Posted: 04 Feb 2015 at 2:12am
Hi,

I have an issue with the Group sorting on my crystal 11 report.

I have a report grouped by Vendor, contract no and part no.

The contract no should be sorted in ascending order but it only seems to look at the 1st digit rather than the whole number? i.e.

the records show like this:
1001
200
201
203
5
6
7
854
860
9
97

etc...

I'm sure there is an easy way to get this sorted properly, but I'm only a very basic user I'm afraid.

Many Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Feb 2015 at 4:48am
it is sorting a string not a number
if your value is laways numeric use a formula to convert it to a number and sort (group) it on that.
e.g.
tonumber(field)
 
If it is possible that it is not a number use a formula to add lead zeros to it so it is always the same string length padded with the zeros on the left
eg
RIGHT("00000000000000000000"+field,20)


Edited by DBlank - 04 Feb 2015 at 4:50am
IP IP Logged
gemcka
Newbie
Newbie


Joined: 02 Aug 2011
Online Status: Offline
Posts: 16
Quote gemcka Replybullet Posted: 05 Feb 2015 at 4:23am
Many Thanks!

Works a treat
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum