Results 1 to 3 of 3
  1. #1
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126

    Sorting issue

    I have a text field that contains data such as 1st, 2nd, 3rd etc. When I try to sort I am getting sorts such as 1st, 20th, 29th, 2nd. How can I correct the issue?

    Thanks


    Jim O

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    The field is text type so it is sorting by alpha hierarchy.

    Construct a field that extracts the number part and sort on that field.

    Val([fieldname]) AS SortNum

    Otherwise, create a number type field and don't use ordinals.
    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.

  3. #3
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126
    Thanks for the input. Got it working now.

    Jim O

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

Similar Threads

  1. Sorting issue
    By Erictsang in forum Queries
    Replies: 2
    Last Post: 08-10-2017, 11:07 AM
  2. Sorting issue in report
    By Erictsang in forum Reports
    Replies: 6
    Last Post: 08-08-2017, 12:07 PM
  3. Weird Sorting Issue
    By MattPGA in forum Access
    Replies: 6
    Last Post: 07-17-2017, 12:33 PM
  4. Sorting issue
    By Shawnf in forum Queries
    Replies: 1
    Last Post: 05-28-2016, 11:21 PM
  5. Report Sorting Issue
    By cbgroves in forum Reports
    Replies: 14
    Last Post: 12-01-2011, 08:44 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