Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    May 2003
    Location
    London, Gtr London, England
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Null values (97)

    1. I want to design a Query/Report that lists LastName.
    2. Some of the LastName fields are empty (no data).
    3. In my Report or Query I want to set a criteria that says: "If the LastName field is empty then return the value in the Company field.

    POINT: I do not want to list the Company field value if there is a value in the LastName field.

    Can this be done?
    Iff ([LastName] IsNull, [Company],[LastName])-----If the LastName field is empty then return the value in the Company field.

    Thanks
    Soc

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

    Re: Null values (97)

    I would use
    IIf(IsNull([LastName]),[Company],[LastName])
    but both works
    Francois

  3. #3
    Lounger
    Join Date
    May 2003
    Location
    London, Gtr London, England
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Null values (97)

    Where would you use that.?
    In the criteria row of the Query?

    My query does not include the Company field because I don't want it unless the LastName field is empty.

    Soc

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

    Re: Null values (97)

    In the query, remove the field LastName and in a new empty field 1st row (field), type:
    Name:IIf(IsNull([LastName]),[Company],[LastName])
    'Name' can be anything except the same name as a field used in your table(s) . It will be used as heading of this column in the Normal View of the query
    Francois

  5. #5
    Lounger
    Join Date
    May 2003
    Location
    London, Gtr London, England
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Null values (97)

    Worked perfectly. Thanks. I learned something brand new. I am learning alot.

    Can you grade me on the following?

    I responded to msg. 71249 with message 71294

    Soc

Posting Permissions

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