cfspreadsheet in a query
Hi,
Maybe I am tired but I can't figure this out. I am using cfspreadsheet to read data from a spreadsheet into a query. That works great and I can dump out the data. The problem is that I need to be able to use those results to compare to data on a database table. What I need to do is do a query of queries to pull data based on a list of strings I get from the database. The problem is that no matter what I do, the string from the database never gets formatted correctly. This is the code I am working with:
<cfspreadsheet
action="read"
headerrow="true"
src = "#thisDirectory#newdatafile.xls"
query = "newcodes"
excludeHeaderRow = "true">
<cfquery name="getcurrentcodes" datasource="#Request.maindatasource#">
SELECT code FROM currenttableindatabase
</cfquery>
<cfset oldcodelist = ValueList(getcurrentcodes.code)>
<cfset trimmedoldcodes = Replace(oldcodelist," ","","all")>
<cfquery name="GetNewCodes" dbtype="query">
SELECT newcode FROM newcodes
WHERE newcode NOT IN <cfqueryparam value="#trimmedoldcodes#">
</cfquery>
It seems like such a simple thing but I either get double quotes around every item or no quotes. I have also tried PreserveSingleQuotes. Does anybody have any ideas.
Red
