Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acc 2007 nedd help with inner join and not equal to

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
0
36
US
I have two tables: I want to compate emails in both tables based on last name.

I want to find everyone whose email is differnt from what we have on file to update it. the table we have on file is called [Data from pdf Latest] teh moste recent email is in the [WordCalendarDirectoryDump] table.
Here is my query , right now it appears to be ignoring the "not equal to" and returning eveything.

Code:
SELECT [Data from pdf Latest].Lastname, WordCalendarDirectoryDump.Parents, [Data from pdf Latest].[EMail Address], WordCalendarDirectoryDump.email
FROM WordCalendarDirectoryDump INNER JOIN [Data from pdf Latest] ON WordCalendarDirectoryDump.Lastname = [Data from pdf Latest].Lastname
WHERE ((([Data from pdf Latest].[EMail Address])<>[WordCalendarDirectoryDump].[email]));

TIA

DougP
 
Assuming you have three Smith's, John, Jane and Mark; I would expect them each to have different e-mail addresses. Since they share a last name then John's e-mail address is not equal to Jane's and Mark's e-mail address. So you get both of those even if they do match one to one.

I am just guessing that is your issue since you are joining on last name. I do not see first name.
 
these are families at the church I just need last name and email.
Compatre last names and see if email is differnt is all I need.

DougP
 
Your query seems to be describing the same thing you are saying...

You might try looking for repeated last names in both list or other data issues.
 
So you are saying there are no two people with the same Last Name in either [Data from pdf Latest] or [WordCalendarDirectoryDump]? I agree with lameid that this is the most likely cause of your trouble.

Otherwise, I suspect your [EMail Address] and fields look the same but are actually different, for example maybe one has an extra space at the beginning or end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top