Solved

Access Query with Where Clause

Posted on 2013-05-24
3
390 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

734 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