Dear all The following works:
<CFQUERY name = "q1" DATASOURCE ="#ds1#"> SELECT catslist FROM comps WHERE compref = #compref# </CFQUERY> note that catslist is a valid list of numbers eg '1,2,3,4' stored in a text field <CFQUERY name = "q2" DATASOURCE ="#ds1#"> SELECT catname FROM cats WHERE cat in (#q1.catslist#) </CFQUERY> cat is an integer datatype But if I do it all as one query as below, I get a data type mismatch error. There must be a way of casting the data produced by the subquery so the main query understands the sub query is producing a list of numbers rather than a single string.... but I don't know how / can't find an answer.... <CFQUERY name = "q2" DATASOURCE ="#ds1#"> SELECT catname FROM cats WHERE cat in (SELECT catslist FROM comps WHERE compref = #compref#) </CFQUERY> This is currently access by the way, but it will eventually be moved to SQL server so a solution for either would be welcome. -- Regards; Richard Meredith-Hardy ------------------------------------------------------------- [EMAIL PROTECTED] ______________________________________________________________________ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation � $99/Month � Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

