Click to See Complete Forum and Search --> : SQL Query - Using LIKE


rc113943
09-06-2007, 09:36 AM
Need help. Here is my current query:

SELECT DISTINCT H_ImportItems.Series, H_ImportItems.Operating, H_ImportItems.Spacer, H_ImportItems.Gas, H_ImportItems.Ilite, H_ImportItems.IThick,
H_ImportItems.Clite, H_ImportItems.CThick, H_ImportItems.Olite, H_ImportItems.OThick, H_ImportItems.Grids, NFRC.U, NFRC.SHGC, NFRC.VLT, NFRC.NFRCID

FROM H_ImportItems INNER JOIN NFRC ON

H_ImportItems.Series = NFRC.Series AND
NFRC.Grids = H_ImportItems.Grids AND
NFRC.Spacer = H_ImportItems.Spacer AND
NFRC.Gas = H_ImportItems.Gas AND
NFRC.Ilite = H_ImportItems.ILite AND
NFRC.IThick = H_ImportItems.IThick AND
NFRC.Clite = H_ImportItems.Clite AND
NFRC.CThick = H_ImportItems.CThick AND
NFRC.Olite = H_ImportItems.OLite AND
NFRC.OThick = H_ImportItems.OThick

WHERE NFRC.Active = 'True'

ORDER BY H_ImportItems.Series

Where I have a problem is H_ImportItems.Series sometimes has "added" characters at the end or beginning when compared to NFRC.Series

ie: NFRC.Series = 3500 ... which is equivalent to H_ImportItems.Series = 3500PW

What I think I need is the proper syntax for:

H_ImportItems.Series LIKE %NFRC.Series%

That obviously gives an error, so now I am confused!! Not too experienced with SQL, so maybe I am going about this the wrong way. Please help! Thank you :)

rc113943
09-06-2007, 10:00 AM
Resolved in another forum. Here is solution, FYI

H_ImportItems.Series LIKE '%' + NFRC.Series + '%'