February 1, 2003 at 2:39 pm
Can someone help convert this Access SQL to TSQL. Much appreciated!
SELECT sfProducts.prodName, grades.GRADE, grades.MATERIAL, grades.ANSI, grades.ISO_RANGE, grades.COATING, grades.GRADE_DESCRIPTION
FROM grades INNER JOIN
sfProducts ON grades.mfgID = sfProducts.prodManufacturerId
WHERE (sfProducts.prodID = 'TTA 100114') AND (INSTR(sfProducts.prodName & ' ', ' ' & grades.GRADE & ' ') > 0)
Kim
Regards,
Kim(Kman)
February 1, 2003 at 2:59 pm
The basic join should be fine, I think if just change instr to charindex it will work.
Andy
February 1, 2003 at 3:17 pm
Thanks Andy,
Changing to
(CHARINDEX(sfProducts.prodName & ' ', ' ' & grades.GRADE & ' ') > 0)
I get
Invalid operator for datatype. Operator equals boolean and datatype equals nvarchar.
Kim
Regards,
Kim(Kman)
February 1, 2003 at 3:40 pm
John Bell helped out on this. Thanks much for the lesson here.
SELECT sfProducts.prodName, grades.GRADE, grades.MATERIAL, grades.ANSI, grades.ISO_RANGE, grades.COATING, grades.GRADE_DESCRIPTION FROM grades, sfProducts WHERE sfProducts.prodId = 'PL 01220' AND grades.mfgID = sfProducts.prodManufacturerId AND (CHARINDEX(grades.GRADE + SPACE(1), SPACE(1) + sfProducts.prodName + SPACE(1)) > 0)
Regards,
Kim(Kman)
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply