Results 1 to 4 of 4
  1. #1
    pjordan@drcog.org is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2011
    Location
    Denver, CO
    Posts
    71

    Multiple Sorting and Order of Fields Question

    I have several fields, the query has a few fields sorted as follows:



    LOC - Sorted
    LONG- sorted
    LAT - sorted

    Now I know access will base the sorting off the first field that is sorted (LOC) and then the next field that has a sort defined (LONG) and then (LAT).

    My issue is I want to run the Query (to fix the LONG and LAT easily), but I want to have the Query sort by LONG 1st and then LAT, then LOC. However in the results after running the Query, I still want the order to show LOC, LONG, LAT and not LONG, LAT, LOC.

    Is there an easy way to specify an order hierarchy to the Fields to sort by other than moving the order (as LONG, LAT, LOC) in the Query?

    Thanks...

  2. #2
    pjordan@drcog.org is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2011
    Location
    Denver, CO
    Posts
    71
    I found that it seems to work if I change the ORDER in the SQL part after I run the Query from"

    ORDER BY Crash_Data_2011_DRCOG.[LOC], Crash_Data_2011_DRCOG.[LONG], Crash_Data_2011_DRCOG.[LAT];

    ORDER BY Crash_Data_2011_DRCOG.[LONG], Crash_Data_2011_DRCOG.[LAT], Crash_Data_2011_DRCOG.[LOC];

    And then going back to the Query Results tab. Is there any way to do this in the main Query or can it only be accomplished in the SQL form?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    In the query builder grid, pull in the fields for viewing then also pull in fields for sorting, uncheck the box on the Show row.

    But why does the field display order matter in query? Users should not work with tables and queries - only forms and reports.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    pjordan@drcog.org is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2011
    Location
    Denver, CO
    Posts
    71
    For what I need to do, I just need to fix Lat and Longs, no need to do a form for that. I have many queries I do for my data which is just fixing names and or location details. The order matters in the query as it's easier to copy the location and paste into Google Maps to get the lat/long and then tab over to the Lat/Long and paste the data in. With the other order, it's just not as fast or natural to do that's why.

    I don't use the Query Builder at all (or rarely for more complex things). I may try that out then and see how it builds the query and then I can do it manually myself.

    Thanks for the idea...

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

Similar Threads

  1. Replies: 6
    Last Post: 02-26-2014, 05:06 PM
  2. Replies: 6
    Last Post: 01-19-2014, 09:30 AM
  3. Replies: 4
    Last Post: 09-09-2013, 11:37 AM
  4. Sorting Order query
    By drunkenneo in forum Queries
    Replies: 1
    Last Post: 06-24-2013, 06:54 AM
  5. Sorting a form's records in order by date.
    By slikbaz in forum Access
    Replies: 3
    Last Post: 11-20-2010, 01:11 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