Results 1 to 2 of 2
  1. #1
    sambucaman is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Apr 2012
    Posts
    2

    help needed with filtering

    Hi guys
    I have a table "customers" with name, address, phone, email etc

    I'd like to run a query to list customers by town, but ONLY display results that have email addresses (so I can export this list to my email program)



    Using Access2003, I have very limited knowledge of how to do this, is there any way someone can talk me though it? I would normally create a query in design view, and enter
    Like "*" &
    [List by town] & "*"
    to show all my customer in xxxtown.

    I've searched and seen i need to enter IS NOT NULL in the email field, but I can get this to work correctly at all. If i enter IS NOT NULL in the criteria row, by search doesn't work and I get a list of ALL towns. If I enter IS NOT NULL in the OR row, my search does work, but I still get results where the email is blank.

    Any ideas what I'm doing wrong?

    Thanks in advance

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    The query would look something like this. You need an AND, OR will not work since you need both conditions to pull the correct data.

    SELECT tblCustomer.txtCustName, tblCustomer.txtAddress, tblCustomer.txtCity, tblCustomer.txtemail
    FROM tblCustomer
    WHERE tblCustomer.txtemail Is Not Null AND txtCity like "*" &
    [List By Town] & "*"

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

Similar Threads

  1. Help Needed
    By sdecaire in forum Access
    Replies: 2
    Last Post: 11-11-2011, 03:07 PM
  2. Help Needed
    By vkmarty in forum Access
    Replies: 1
    Last Post: 09-23-2011, 07:23 AM
  3. Sub form help needed
    By wildthingcg in forum Access
    Replies: 10
    Last Post: 08-30-2011, 11:49 AM
  4. Help needed
    By longbo43 in forum Access
    Replies: 3
    Last Post: 09-27-2010, 10:18 AM
  5. Help needed...
    By Pazz in forum Access
    Replies: 0
    Last Post: 11-02-2009, 06:59 PM

Tags for this Thread

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