• Null values (97)

    Author
    Topic
    #359936

    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

    Viewing 0 reply threads
    Author
    Replies
    • #540789

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

      • #540793

        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

        • #540797

          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

          • #540799

            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

    Viewing 0 reply threads
    Reply To: Null values (97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: