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

Group by Specified Order

Status
Not open for further replies.

mynameant

Programmer
Oct 19, 2005
64
US
I am using CR 10 and was trying to order my existing Group by a specified order.
My group by is on a column name called CODE. It has values like 'a1','a2','a3',...'a45' and sometimes not even in series. So if i have to specify order, the only way i know is, go to change group and click on specified order and select one by one [group ]. I have to do this for 45 times to include all . Is there any other way to do this?

can I cut & paste all the values that i want to specify for ordering, from a notepad or from some other tool that i have?


Thanks, Please let me know if you need more details
 
You could create a formula to group by the numeric value if that is how you wish to group/order them.

"not even in series" implies that you have some order which differs from any existing logical grouping, so I would suggest that you add in a meaningful field/key to the database.

If you just want them ordered by the values within use the following formula for your group field:

Stringvar MyVal:="";
numbervar Counter;
For Counter := 1 to len(trim({table.field})) do(
if isnumeric(mid({table.field},Counter,1)) then
MyVal:=MyVal + mid({table.field},Counter,1)
);
Val(MyVal)

-k
 
You are correct. "Not even in series" because of some specified order for that particular result set.

Your formula will work for me. but where do i specify this formula for a group field? and how can i force report to use this formula and do a sort as per the values from formula?
I could add a numeric field to database, but that's for another day. I have to work something[temp solution] out before that.

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top