-
Custom Sorting
Hello everybody,
I need to sort data in the crystal report based on a field called "SWOT". SWOT field can only contain "Strength","Weakness","Opportunity" or "Threat". I need to sort the field in the order below:
Strength
Weakness
Opportunity
Threat
Thanks.
-
Re: Custom Sorting
This is how you can do it:
Add a field to your database numbering the the items in the sort order you want them. Like this:
Number / Item
1 S
2 W
3 O
4 T
Then, add the Item field to your report and it will be in the right order. At least it did for me.
-
Re: Custom Sorting
Thanks. This is a solution but isn't there any other way to play with existing databse. Actually application has been developed and changing the database may have some impacts on other things.
-
Re: Custom Sorting
I suppose, you could do a select case statement to order the records. Personally, I think that would be more difficult.
I can't see how adding one field to a table to signify sort order would be a problem, but I don't know your database structure...
Try a select case statement.