The in statement that didn't work - what was it and what happened when you ran it?
select carname from CarTable
WHERE CarTable.carcode in ('#queryname.car_storage#')
It doesn't give me an error, but it does bring back zero records and I have confirmed that the content in the database should be a match.
I'm outputting the recordcounts found and the sring that is in #queryname.carstorage#
No records, but the letters match the letters in the database. Hmmmm... I am guessing it is something simple that I am missing.
If you have records with these values,
then your first mistake is that you designed your database poorly. Storing lists in a single field is essentially stroring unuseable data. A one to many relationship is better. If you don't know what that is, I've heard good things about the book, Database Design for Mere Mortals.
Next, this syntax, #queryname.car_storage#, only returns the first record. To get all the records, use the valuelist function.
Next, in sql, if you have a list of strings, each one has to be quoted. Something like this.
where myfield in ('a', 'b', 'c')
The best way to achieve this in ColdFusion is to use the cfqueryparam tag with the list attribute set to yes.
Thank you. I wish I had been the designer of the database but this is part of where I have to talk to the old database system. Until 2014 this is what I get to work with. Thanks for the advice on cfqueryparam, I'll give that a shot.