How can i get this SQL statement to remove apostrophes

Hey everyone,

I have the following SQL statement:


SELECT	Out.ID 
FROM	Quote Inc 
INNER JOIN Quote Out ON Inc.Code = Out.Code 
WHERE Inc.ID IN (@TourIDString) AND Inc.ID <> Out.ID

@TourIDString contains values like so:

‘89918, 89641, 89644, 89668, 89649’

So when putting this into context, the SQL Statement in return would be this:


SELECT	Out.ID 
FROM	Quote Inc 
INNER JOIN Quote Out ON Inc.Code = Out.Code 
WHERE Inc.ID IN ('89918, 89641, 89644, 89668, 89649') AND Inc.ID <> Out.ID

My question is, that is there any way or removing the apostrophes so that i am returned with this:


SELECT	Out.ID 
FROM	Quote Inc 
INNER JOIN Quote Out ON Inc.Code = Out.Code 
WHERE Inc.ID IN (89918, 89641, 89644, 89668, 89649) AND Inc.ID <> Out.ID

Hope someone can help me out?

Kind regards,

do that with whatever application language you’re using

it’s not a problem for sql, it’s a problem in constructing the proper query string before you execute it

should it not be


'89918','89641','89644','89668','89649'

?

That’s the only way I have got an array to work correctly in that usage. (maybe it’s a perl thang).

bazz

no it shouldn’t, it’s a numeric column :slight_smile: