Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IIf in Query (2000)

    I want a query to use the business telephone number. If it is blank, use the home phone number. When I try this in a query:
    telephone: IIf([business telephone]=Not Null,[business telephone],[primary home phone]) the result is always the primary home phone? What am I doing wrong??

  2. #2
    New Lounger
    Join Date
    Mar 2002
    Location
    North Carolina
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IIf in Query (2000)

    Try

    Telephone: IIF(([Business] = " "),([Primary]), ([Business]))

  3. #3
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IIf in Query (2000)

    You need this:

    IIf(Not IsNull([business telephone]),[business telephone],[primary home phone])

    You cannot evaluate '= Null'
    Any expression with Null in it always evaluates to Null
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IIf in Query (2000)

    Even simpler:
    Telephone: Nz([business telephone],[primary home phone])
    Francois

Posting Permissions

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