search query, excluding fields (1 Viewer)

sambucaman

Registered User.
Local time
Yesterday, 22:25
Joined
May 6, 2010
Messages
41
Hi everyone.
I want to run a search of my table "customers", and search in the "town" field for a certain town, but only display results of customers with an email address.

Id normally do a search by the following
Code:
Like "*" & [Search customers by town] & "*"

So, is there a way to exclude entries that DONT have an email address in the "email" field. So in other words, list results of exeryone in xxxtown that has an email address (then I can add that report to by mail list etc)

Thanks for your help
 

Trevor G

Registered User.
Local time
Today, 06:25
Joined
Oct 1, 2009
Messages
2,341
in your query set the critiera to IS NOT NULL
 

sambucaman

Registered User.
Local time
Yesterday, 22:25
Joined
May 6, 2010
Messages
41
Like this?



Its still listing all the records that don't have an email address.
 

Trevor G

Registered User.
Local time
Today, 06:25
Joined
Oct 1, 2009
Messages
2,341
Have you create a query based on the table, if so then you can set the criteria in the query to IS NOT NULL as I have suggested. So the SQL would show this

WHERE (((tblLogon.EmailAddress) Is Not Null));
 

sambucaman

Registered User.
Local time
Yesterday, 22:25
Joined
May 6, 2010
Messages
41
Hi trevor, thanks for your answers. Still cant get it working correctly, I'll keep trying though!
 

Trevor G

Registered User.
Local time
Today, 06:25
Joined
Oct 1, 2009
Messages
2,341
Have you created a query rather than look to use the table. The query you can set your criteria.
 

Users who are viewing this thread

Top Bottom