Results 1 to 3 of 3
  1. #1
    Mina Garas is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    33

    Sorting Queries

    Hi Everybody

    am trying to sort my queries by alphabet but it doesn't work


    i give serial for my queries such as : qry1_Name , Qry2_Name , Qry3_Name .....etc
    its working until i reach to qry10_name
    and its appear like that
    qry1_name
    qry10_name
    qry2_name
    qry3_name
    etc

    how can i fix it to appear like that
    qry1_name
    qry2_name
    .
    .
    .
    Qry9_name
    qry10_name
    qry11_name

    help me please

    thanks alot

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    When you sort text, they are compared left to right. Numbers in a text string are not numbers. They are characters.

    To sort like you want, you need the same number of "Numbers". If the maximum "number" will be 3 digits, you will need to have left padding zeros.
    For 0 to 99:

    qry01_name
    qry02_name
    .
    .
    qry98_name
    qry99_name


    For 0 to 999:
    qry001_name
    qry002_name
    .
    .
    .
    qry098_name
    qry099_name
    .
    .
    .
    qry998_name
    qry999_name

  3. #3
    Mina Garas is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    33
    Thanks alot its working

Please reply to this thread with any new information or opinions.

Similar Threads

  1. queries based on union queries
    By vicsaccess in forum Queries
    Replies: 3
    Last Post: 10-10-2015, 07:53 PM
  2. Replies: 9
    Last Post: 08-27-2014, 11:34 AM
  3. Sorting Tables and Queries
    By TimC in forum Access
    Replies: 1
    Last Post: 02-21-2014, 11:24 AM
  4. Replies: 11
    Last Post: 01-12-2012, 07:55 PM
  5. Sorting
    By BorisGomel in forum Access
    Replies: 0
    Last Post: 04-25-2011, 11:22 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
  •  
Other Forums: Microsoft Office Forums