Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Iff statement code (2002)

    I am trying to write an Iff statement code that would :
    If the field [county] on the report has data in it I want the textbox txtCounty to print [county] and "County" If no data in [county] then nothing would print in txtCounty.

    I'm not sure how to say nothing in the Iff statement.

    Iff({county] is null, [county]&"County") didn't work.

    Thanks for the help

    Paul

  2. #2
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Iff statement code (2002)

    The following should work.

    iif([county] is null,"",[county] & " County")
    or
    iif(isnull([county]),"",[county] & " County")

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

    Re: Iff statement code (2002)

    In an expression you can also use
    <code>
    [County]+" County"
    </code>
    Unlike the & operator, + returns Null when at least one of the arguments is Null.

  4. #4
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Iff statement code (2002)

    That worked.

    Thanks Mike and Hans.

Posting Permissions

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