Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Query Help - Using LIKE

Author  Topic 

rc113943
Starting Member

2 Posts

Posted - 2007-09-06 : 10:42:16
Need help. Here is my current query:

[CODE]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[/CODE]

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 :)

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-09-06 : 10:46:30
H_ImportItems.Series LIKE '%' + NFRC.Series + '%'

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -