Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

Access Query with Where Clause

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
jsawicki
Asked:
jsawicki
1 Solution
 
pdebaetsCommented:
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
 
jsawickiAuthor Commented:
So i had it right, just a documentation error on my part.  thx
0
 
Dale FyeCommented:
"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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now