Results 1 to 4 of 4

Thread: Custom Sorting

  1. #1

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    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.

  2. #2
    Lively Member
    Join Date
    Dec 2004
    Posts
    121

    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.

  3. #3

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    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.

  4. #4
    Lively Member
    Join Date
    Dec 2004
    Posts
    121

    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.
    Last edited by Malim; Mar 19th, 2005 at 10:10 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width