Results 1 to 6 of 6
  1. #1
    Xrayjohn is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2018
    Posts
    4

    Criteria in a query

    I have a query with 3 fields. Name, Mobile, and E-Mail. I want to add a criteria that returns only those records where at least one of the Mobile and E-Mail fields has data. HELP

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    SELECT tClients.Name, tClients.PhoneCell, tClients.EmailWk
    FROM tClients
    WHERE (((tClients.Email) Is Not Null)) OR (((tClients.PhoneCell) Is Not Null));

  3. #3
    Xrayjohn is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2018
    Posts
    4
    How is this added? I tried to put it in the Criteria box under the Name field but it does not work there.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    in the criteria,
    field 1 (email) , on 1st criteria, put: NOT NULL
    field 2 (phone) , on 2nd SEPARATE line criteria (NOT THE SAME LINE AS ABOVE) , put: NOT NULL

    Thats what makes the 'OR'.

  5. #5
    Xrayjohn is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2018
    Posts
    4
    Click image for larger version. 

Name:	70A0283D-2785-4837-9E5E-B7A6364D7B4F.png 
Views:	13 
Size:	15.6 KB 
ID:	32609I get this error message.

  6. #6
    Xrayjohn is offline Novice
    Windows 10 Access 2007
    Join Date
    Feb 2018
    Posts
    4
    I tried just the IS NOT NULL statements and that solved the problem. Thank You!!!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 04-02-2015, 12:45 PM
  2. Replies: 4
    Last Post: 08-30-2014, 10:23 AM
  3. Replies: 5
    Last Post: 09-20-2012, 03:27 PM
  4. Replies: 5
    Last Post: 08-02-2012, 09:44 AM
  5. Replies: 1
    Last Post: 07-13-2011, 11:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums