Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sorting queries (Access2000)

    Is there anyway I could have 2 differents sorting method in one query??
    For example lets say I have few different food packed bottles and tins etc. I sort this feild and then whicher food falls into each catoogory for example there are fruits and veggies in tin food category, I want them to be sotted within that category.

    Is this possible? I know Im confusing, but all I want to do is have a primary sort and a secondary sort.
    <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Sorting queries (Access2000)

    You should be able to do this by grouping and sorting the query data. Go to the Microsoft Support Knowledge Base and input Q207626 in the "My Question is" area. You will connect to a sample database that you can download detailing various query types. One shows how to group and sort your data in a query which should do what you describe.

    Good Luck
    Regards,

    Gary
    (It's been a while!)

  3. #3
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Sorting queries (Access2000)

    Hi,
    Yes you can have multiple sorts in queries. Simply add the columns you want to sort by to the query grid in the order you want to sort them - i.e. if you want to sort by category then by food, the category field needs to be on the left of the food field in your grid. If you don't want the fields in this order you can either highlight and drag the relevant column after running the query (i.e. in the datagrid) or edit the SQL directly and change the order they appear in the ORDER BY clause.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  4. #4
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sorting queries (Access2000)

    Thanx Rory!
    Thats what I wanted to do!
    <img src=/S/kiss.gif border=0 alt=kiss width=34 height=15> 4 Rory.
    <img src=/S/bow.gif border=0 alt=bow width=15 height=15> 4 all who tried to help <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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