Need query to compare first 5 characters of Fname of Tab1 with irst 5 characters Tb2
Thanks,
Need query to compare first 5 characters of Fname of Tab1 with irst 5 characters Tb2
Thanks,
Create a query that joins on the two fields. In SQL view, add the Left() function to both sides of the join and see if that works.
Hi,
I have this query.Could you help me to put Left() function as I am getting syntax error.
SELECT Table1.[First name], Table1.[Last name], Table1.ZIPCODE, Tabl2.Email
FROM Table1 LEFT JOIN Tabl2 ON (Table1.ZIPCODE = Tabl2.ZIPCODE) AND (Table1.[Last name] = Tabl2.[Last name]) AND (Table1.[First name] = Tabl2.[First name]);
I need to return Email ID if the first 5 character ofTabl1 (Fnname) matches with First 5 character of Table2 (Fname) and same condition for other two fields.
Thanks
This type of thing
LEFT JOIN Tabl2 ON (Left(Table1.ZIPCODE, 5) =
Hi ,
Can you provide complete Query as I am getting syntax error.
Thanks
Getting syntax error.
SELECT Table1.[First name], Table1.[Last name], Table1.ZIPCODE, Tabl2.Email
FROM Table1 LEFT JOIN Tabl2 ON (Left(Table1.ZIPCODE,5) =(Tabl2.ZIPCODE,5) AND (Table1.[Last name] = Tabl2.[Last name]) AND (Table1.[First name] = Tabl2.[First name]);
Thanks
You seem to be missing a LEFT at, but it isn't clear what exactly you want in the result; or what exactly you are comparing zip code, firstname, last name or combinations of these.=(Tabl2.ZIPCODE,5)
The records that are equal, or the records that are not equal.
Can you tell us why you chose LEFT JOIN?
Yes I need to Compare all three fields...and I should return Email if all condition met.
Like Left(Table.fname,5)=Left(Table2.Fname,5)
I used LEFT Join Because I want all data of Left Table
Please provide query
You've already got it:
Left(Table.fname,5)=Left(Table2.Fname,5)
The syntax to solve your issue, as Paul said , you've already got it.
The issue may now be spelling - earlier posts have
Table1.[First name], Table1.[Last name], Table1.ZIPCODE, Tabl2.Email
In post #8
you have ...Left(Table.fname,5)=Left(Table2.Fname,5)