I have a query I need to remove a bunch of columns from a sqlServer query for generating reports. Most of the columns have spaces in the names. I tried a QofQ using a string to hold the column names:
<cfset sysDevStr = "'PROJECT DATE','R CODE','REGION'" /> 'cfquery name=chgQry dbtype="query"> SELECT #sysDevStr# FROM localQry </cfquery>'
results in: Query Of Queries syntax error.
Encountered ""\'\'. Incorrect Select Statement, Expecting a 'FROM', but encountered '''' instead, A select statement should have a 'FROM' construct
when I try:
'cfquery name=chgQry dbtype="query"> SELECT * FROM localQry </cfquery>'
I get the data, but that's not helping me cut out the unneeded columns
when I try:
'cfquery name=chgQry dbtype="query"> SELECT 'Project date' FROM localQry </cfquery>'
or SELECT #PreserveSingleQuoutes(sysDevStr)# I get a table full of entries that say exactly whatever the column names are.
I've tried surrounding the column names with brackets, brackets with double quotes, back-tics, etc, with no luck. What am I doing wrong? How do I get a query with a subset of column data?
thanx

New Topic/Question
Reply
MultiQuote









|