Solved

Access Query with Where Clause

Posted on 2013-05-24
3
349 Views
Last Modified: 2013-05-24
I created the code below so when i am comparing these two tables, i retrieve only the results where the email address for a cell phone number is not the same.  This would indicate the number has been reassigned to another user.  

I thought i could just use a where clause indicating the email address in each table not being equal, but i keep receiving a popup to enter data.  

What should my code look like to make this query function properly.  

SELECT New_List.Email_Address, New_List.Cell_Number, Baseline.Cell_Number, Baseline.Email_Address
FROM Baseline RIGHT JOIN New_List ON Baseline.Cell_Number = New_List.Cell_Number
WHERE ((([New].[List].[Email_Address])<>[Baseline].[Email_Address]));

Thanks
0
Comment
Question by:jsawicki
3 Comments
 
LVL 12

Accepted Solution

by:
pdebaets earned 500 total points
ID: 39195204
Try this:

SELECT New_List.Email_Address, New_List.Cell_Number, Baseline.Cell_Number, Baseline.Email_Address
FROM Baseline RIGHT JOIN New_List ON Baseline.Cell_Number = New_List.Cell_Number
WHERE (((New_List.[Email_Address])<>[Baseline].[Email_Address]));
0
 

Author Closing Comment

by:jsawicki
ID: 39195221
So i had it right, just a documentation error on my part.  thx
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39195223
"i keep receiving a popup to enter data"

When you get a popup asking you for a field value that is a pretty good indication that you have listed a field that does not exist somewhere in the query.

As Peter indicates, your syntax:

[New].[List].[Email_Address]

is not correct, at least not based on the rest of the query.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now