pull null value from either of the two columns or both columns

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kparson1
    New Member
    • May 2010
    • 2

    #1

    pull null value from either of the two columns or both columns

    I am doing a query in access. I want to pull all the clients names that have a null value in two separate columns. I want everyone pulled that has a null value in either of the two columns or both of the columns. When I put "is Null" in both of the columns, it is only pulling clients names who are null in both columns. If a client is null in just one or the other column it does not pull them. I want it to pull everyone who is null in either of the columns or both of the columns
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    There's probably a slicker way, but this works, assuming the columns are both Text:
    1. In the Query Design Grid, create a calculated field: CombinedColumns :Nz([Column1]+[Column2],"EmptyField ")
    2. Leave the "Show" checkbox unticked.
    3. In the Criteria Box enter: = "EmptyField "

    Welcome to Bytes!

    Linq ;0)>

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32669

      #3
      In your query grid, notice there is a row below the Criteria: one that reads Or:.

      If you put the criteria for one column against the Criteria: row and the criteria for the other against the or: row then it will select records where either of the columns is blank.

      NB. Multiple levels of OR can be handled this way by using the rows beneath.

      Comment

      • kparson1
        New Member
        • May 2010
        • 2

        #4
        Originally posted by NeoPa
        In your query grid, notice there is a row below the Criteria: one that reads Or:.

        If you put the criteria for one column against the Criteria: row and the criteria for the other against the or: row then it will select records where either of the columns is blank.

        NB. Multiple levels of OR can be handled this way by using the rows beneath.
        Thank you so very, very much. I did it and it worked! Thanks a million!!!

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32669

          #5
          Not a problem K. That's what we're all here for :)

          Comment

          Working...