Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Posts
    33

    Unanswered: Advanced Sorting of Records

    I got a hard one for you geniouses out there. I'm trying to create what I can only describe as "group sorting". I have searched endlessly, and have come up with nothing. Basically, what I am trying to accomplish:

    The record has 2 fields that require sorting:
    NumDays & Company

    First I want to group and sort the records by NumDays:

    Example:
    > 400
    400 - 300
    300 - 200
    200 - 100
    < 100

    Then I want to sort the contents of each group alphabetically by Company Name.

    The query/recordset must remain updateable somehow.

    I'm starting to think this is impossible.
    HELP!!!!!!!

    Thanks,

    Abdiel

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by absoffthewake
    I'm starting to think this is impossible.
    Far from it
    Code:
    ....
    ORDER BY SWITCH(NumDays > 400, 1, NumDays BETWEEN 300 and 400, 2, NumDays BETWEEN 200 and 300, 3, NumDays BETWEEN 100 and 200, 4, 1=1, 5), Company
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Aug 2002
    Posts
    33

    Thumbs up

    Awesome!! Just what I needed. Thanks!!

Posting Permissions

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