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

Sorting Problem

Status
Not open for further replies.

pandy1

Programmer
Oct 9, 2002
52
US
Hi,

I have a "Status" field in the request table. The data in the status field is:

requested
program manager approved
assigned
research

etc., the user wants the sort order: assigned,research,program manager approved and requested.

How is it possible? when i use the status field for sorting i could sort by alphabetical order.

Please help.

thanks
pandy
 
Hi Pandy,

Create a status_sort formulae and sort on that new formulae.

e.g.
{@status_sort}
Select {table.Status}
case 'requested' :1
case 'program manager approved' :2
case 'assigned':3
case 'research':4
default :5;
The default is there just in case you get a new status that you were not expecting.

Fred

 
Not knowing what version you have but in Crystal 8.5

Right click on the group header -> Change Group

From the Change Group Window, click on the down arrow and select in specified order. Then you can specify the order you want.
 
Good point wichitakid,

I forgot about the grouping and specifying a sort order.

Fred
 
Thanks a lot wichitakid and Fred.

pandy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top