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

totext(numeric) sorts wrong 1

Status
Not open for further replies.

amoeba102

Programmer
Apr 2, 2002
58
US
I searched the archives but evidently used the wrong criteria. I'm trying to make the group tree more useful. The group name is numeric {cngroup} and right now all the user sees is

1
2
3
4
etc. but there are responsible individuals assigned to each group and I would like the tree to show

1 Mary Brown
2 George Smith
3 Jim Jensen
4 Carol Green

My current version is
totext({cngroup},"#")+" "+{@name}). I've tried many other versions, all with the same result - the numeric portion then sorts
1,10,11,12,13,14,15,16,17,18,19,2,20,21 etc.

How can I get it to sort the way we need?
 
Working with CR9 right now, but I think this applies to other versions as well...

Keep your group on {cngroup}, but set the Group options to "Use a formula as Group Name" (right-click on the Group>Change Group, etc.), and use your formula. Then, in the Group Tree, you should see the groups displayed in the format you want them, retaining your numeric sorting.

-dave
 
Thank you! I thought I had used every combination possible, but I guess I missed that one. It worked!
 
Hi,
As long as you convert the numbers to text, the alpha order will be as you have seen..

Sorting of text is by the ASCII value of the string, so
11 follows 1 not 2 .

If only 1 person is associated with the {cngroup} then just add the {name} field to the group header..

[profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top