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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting partial match between two fields

Status
Not open for further replies.

wdbouk

Technical User
May 28, 2003
81
CA
Hello,
I have two columns one with 9 character and the other with 8. I want to match the two columns where the first 8 characters of both matched.
I used the following:

SELECT FinancialQ.*, IssueM.*
FROM FinancialQ LEFT JOIN IssueM ON FinancialQ.Cusip = IssueM.Expr1000
WHERE ON LEFT( FinancialQ .Cusip,8)=LEFT(IssueM.Expr1000,8) ;

but I receive syntax error (missing operator)in query expression 'ON LEFT( FinancialQ .Cusip,8)=LEFT(IssueM.Expr1000,8)'

Any hint of where i made the mistake?
 
Have you tried this ?
SELECT FinancialQ.*, IssueM.*
FROM FinancialQ LEFT JOIN IssueM
ON LEFT(FinancialQ .Cusip,8)=LEFT(IssueM.Expr1000,8)
;


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
invalid use of .,!or())in query expression 'ON LEFT( FinancialQ .Cusip,8)=LEFT(IssueM.Expr1000,8)
 
Replace this:
FinancialQ .Cusip,8
By this:
FinancialQ.Cusip,8

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes it works :)
the mistake was so small
thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top