Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jun 2002
    Location
    Camp Lejeune, NC
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sorting (A2K SR-1)

    Just a quick question. I am trying to sort ascending by the last 4 numbers of a social security number. Can I do this without creating another field for just the last 4 digits?

    Thanks for the help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Sorting (A2K SR-1)

    You certainly *don't* want to create a field in a table for this.

    If you want to sort in a query, you *do* need a calculated field, defined as (for instance)

    OrderSSN: Right([SSN], 4)

    Sort Ascending on this field. If you don't need it for anything else, uncheck the display checkbox.

    If you want to sort a report, you can do that without creating a field. In the Sorting and Grouping window, enter

    =Right([SSN], 4)

    in the left hand box and Ascending in the right hand box.

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Sorting (A2K SR-1)

    You wrote:
    >>Just a quick question. I am trying to sort ascending by the last 4 numbers of a social security number. Can I do this without creating another field for just the last 4 digits?<<

    John,

    Sure. For example, in the QBE grid of your query, create an expression something like this:
    Expr1: Right(SSN,4)
    Then set its Sort option to Ascending.

    Depending on the size of your database, this may be slow, since Access won't be able to use an index and will have to "manually" sort it.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    New Lounger
    Join Date
    Jun 2002
    Location
    Camp Lejeune, NC
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sorting (A2K SR-1)

    Thank you much. I had seen something like before, but don't really know how to apply them. Again, thanks.

Posting Permissions

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