Forum Discussion

ebenton's avatar
ebenton
Copper Contributor
Jun 18, 2021

Set up query to find missing data in multiple fields

Hey Microsoft Community,   I am trying to set up a query that will find records that are missing data.  For example, I have a main form where users will enter biographical data, but they may be mis...
  • George_Hepworth's avatar
    Jun 18, 2021

    ebenton 

    We could be more precise with more details to work with, but the general pattern would be:

     

    SELECT FirstName, LastName, DateofBirth, PhoneNumber

    FROM tblYourTableNameGoesHere

    WHERE FirstName Is Null OR LastName Is Null OR DateOfBirth Is Null OR PhoneNumber Is Null

     

    However, it is possible that one or more of them is actually a Zero Length String (ZLS) so I'd write that to cover that possibility:

     

    SELECT FirstName, LastName, DateofBirth, PhoneNumber

    FROM tblYourTableNameGoesHere

    WHERE Len(FirstName & "") = 0 OR Len(LastName & "") = 0 OR DateOfBirth Is Null OR Len(PhoneNumber & "") = 0

     

    The date field will be null or have a valid date.

     

    Is that what you tried before? 

     

     

Resources