Results 1 to 2 of 2
  1. #1
    louise is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    112

    Field for extracting part of field to be used for sorting -- in query - or table?

    Hello,
    I have a course code that includes letters followed by numbers, so a text field in my table.

    However, I need to be able to sort the field by the letters and then the numbers. And, I do not want the user entering the information to have to add leading zeroes to numeric part. For example, codes may be FSS-1, FSS-11, FS-1 FS-11

    In a query I am able to extract the numeric part, sort by that calculated field, and the course codes are then in the correct order. (sorry for the font...)
    Extract: Val(((Mid([CourseCode],InStrRev([CourseCode],"-")+1))))

    But, using this in the query would mean I would have to include this calculated field in all my queries -- it seems impractical. Can it be put into the table? Would it recalculate in the table if changes were made? How would I do that? (And is this a normalization non-no?)



    OR any other suggestions for sorting would be welcome!

    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I haven't used it but 2013 has a new calculated field data type.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Part of field matches part of another field
    By fishhead in forum Queries
    Replies: 13
    Last Post: 04-10-2015, 01:54 PM
  2. Query Part of a Field
    By EHittner in forum Queries
    Replies: 1
    Last Post: 01-31-2015, 07:28 PM
  3. sorting table field in ascending order
    By picyx in forum Access
    Replies: 7
    Last Post: 11-18-2014, 02:24 PM
  4. Sorting field in table
    By Lamyatt in forum Access
    Replies: 3
    Last Post: 10-24-2012, 04:56 PM
  5. Query any part of the field
    By spleewars in forum Queries
    Replies: 1
    Last Post: 05-31-2012, 07:13 PM

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