Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query to return only one value (2000/2002)

    I have a table containing 3 fields: Father, Mother, and Guardian. In my query I want one value. If father is null I want the value of mother, otherwise I want the value of father. If both father and mother are null, I want the value of Guardian. I know how to word the iif function if there are only two choices but I can't figure out how to word it to give me one value from three choices.
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

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

    Re: Query to return only one value (2000/2002)

    You have to use nested IIf's:

    IIf(IsNull([Father]),IIf(IsNull([Mother]),[Guardian],[Mother]),[Father])

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query to return only one value (2000/2002)

    That worked great. Thank you very much.
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

Posting Permissions

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