Results 1 to 2 of 2
  1. #1
    susan is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    1

    Question Selecting Just One Name Type

    I am trying to complete a query in Access.
    Let's suppose the table looks like this:

    ID First Name Last Name Prefix Name Type
    123 Susan Jones '89 Ms. 18


    123 Susan and John Jones '89 Mrs. and Mr. 23
    234 Sandy Berger '90 Ms. 18
    567 Alan Johnson Mr. 15
    567 Alan and Amy Johnson Mr. and Mrs. 37 Note that not every ID number has every name type, but every ID will have at least one name type. Only one name type needs to be returned. The order of preference for the name types is as follows:
    If name type 23 exists, return this. If name type 23 does not exist, look for name type 37 and return type 37. If name type 37 does not exist, look for name type 18 and return type 18. If type 18 does not exist, look for type 15 and return this.

    Can someone more experienced than I with sql help with a query that would accomplish this?

    TYIA,
    Susan

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How about describing your needs in different words and separating your fields witha delimiter like "|"?

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

Similar Threads

  1. Selecting multiple records in drop down
    By rscott7706 in forum Access
    Replies: 1
    Last Post: 08-26-2009, 03:00 PM
  2. Help with Selecting a single record in access.
    By rfhall50 in forum Programming
    Replies: 3
    Last Post: 08-10-2009, 08:50 AM
  3. Problem Selecting Records for a Report
    By Joe in forum Programming
    Replies: 0
    Last Post: 09-27-2008, 02:27 PM
  4. Selecting text - ComboBox
    By Numbat in forum Programming
    Replies: 2
    Last Post: 06-05-2006, 05:42 PM
  5. Replies: 1
    Last Post: 03-17-2006, 12:04 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