This content has been marked as final. Show 3 replies
> where NOT IN('#Valuelist(query)#')
Take a look at the SQL this generates, and then consider the SQL it SHOULD
1) SQL "IN clause" lists are not quite the same as CF lists.
Now that I'm looking at the code again, the problem could be the single quotes you've surrounded your value list with. You want the SQL to read:
WHERE myField NOT IN ('item1','item2','item3')
and it looks like the example you give above would read:
WHERE myField NOT IN ('item1,item2,item3')
If you need to surround each item in the list with single quotes, I would recommend the ListQualify() function.
Again, follow Adam's advice before you run your SQL and output the query SQL to the screen to make sure CF is building the query you really want.
Hi everyone, well I started to look into it more and I ended up useing quotedvaluelist and it seemed to do the trick :)
Thanks for all your help it put me on the right track