Advertisement

07.21.2008 at 04:26AM PDT, ID: 23581419
[x]
Attachment Details

Query to find "not null" email fields in 2 fields AND by another criteria

Asked by Newbie_ in Microsoft Access Database

Tags: ,

Hi All,
I have a table with our prospects in.  Each prospet has 2 email fields and a campaign name field. I'd like to write a query that searches for records based on AND & OR criteria.  i.e - All records that campaign=camaign1 and email1=is not null OR email2=is not null.

Here is what i have so far: WHERE (((TAB_Prospects.[Campaign Name])="MF_Crane_Hire_01") AND ((TAB_Prospects.Email) Is Not Null)) OR (((TAB_Prospects.Email1) Is Not Null))

This query does not work ... please help!!Start Free Trial
1:
2:
3:
4:
SELECT TAB_Prospects.[Campaign Name], TAB_Prospects.[Company Name], TAB_Prospects.Title1, TAB_Prospects.FirstName1, TAB_Prospects.LastName1, TAB_Prospects.Email, TAB_Prospects.Email1
FROM TAB_Prospects
WHERE (((TAB_Prospects.[Campaign Name])="MF_Crane_Hire_01") AND ((TAB_Prospects.Email) Is Not Null)) AND (((TAB_Prospects.Email1) Is Not Null))
ORDER BY TAB_Prospects.[Company Name];
[+][-]07.21.2008 at 04:31AM PDT, ID: 22049498

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 04:41AM PDT, ID: 22049533

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 06:34AM PDT, ID: 22050327

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Access Database
Tags: Microsoft, Access 2007
Sign Up Now!
Solution Provided By: peter57r
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628