Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jul 2003
    Location
    Phoenix, Arizona, USA
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query Sort (Access XP, Sp-2)

    I have a field containing names "Employee", that is populated by First Initial and Lastname (A. Smith, A. Jones, etc). I know that's bad, but I inherited this database and am trying to fix it as I go. They have always sorted by Employee, putting the data in order by First Initial. If it is sorted by Lastname, I can save them lots of time on a manual process they do. In my query, if created an Expression EmpLname:Right([Employee], Len([Employee])-3). This part works great, I get the last name only. However, when I try to sort, I get an error message indicating the expression is too complex.
    Please help. Changing the field to 2 separate fields is not a real good option yet.
    Thanks in advance for any help.
    John B.

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

    Re: Query Sort (Access XP, Sp-2)

    A simpler expression with the same result is Mid([Employee],4)

    Do you try to do other things in the same query? I have no problem sorting a query on a calculated expression like the one you use.

  3. #3
    Lounger
    Join Date
    Jul 2003
    Location
    Phoenix, Arizona, USA
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Sort (Access XP, Sp-2)

    I changed the expresion to use Mid(), and now I can sort the query fine.
    The query was pulling data from 5 related tables and Employee field was from the 4th table down the chain. I only had two paramaters in the query.
    Thank you very much for your quick and very useful response!
    John B.

Posting Permissions

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