actually it should probably be:
<cfquery datasource="firmdaily" name="GetMyQueryResults">
#preserveSingleQuotes(myquery)#
</cfquery>
+-----------------------------------------------+
Bryan Love
Macromedia Certified Professional
Internet Application Developer
Database Analyst
TeleCommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+
"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
- Thomas Paine, The American Crisis
"Let's Roll"
- Todd Beamer, Flight 93
-----Original Message-----
From: Bryan Stevenson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 17, 2002 1:27 PM
To: CF-Talk
Subject: Re: Using a variable to collect query-like results
<cfquery datasource="firmdaily" name="GetMyQueryResults">
<cfoutput>#myquery#</cfoutput>
</cfquery>
should read
<cfquery datasource="firmdaily" name="GetMyQueryResults">
#myquery#
</cfquery>
HTH
Bryan Stevenson B.Comm.
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]
---------------------------------------------------------
Macromedia Associate Partner
www.macromedia.com
---------------------------------------------------------
Vancouver Island ColdFusion Users Group
Founder & Director
www.cfug-vancouverisland.com
----- Original Message -----
From: "Clark, Aimee" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, September 17, 2002 1:16 PM
Subject: Using a variable to collect query-like results
> Hello everyone,
> If you had a variable set like the one I have below...how do you then
> reference the variable to display the results? (sorry in advance for the
> long posting)
>
> <-----Here's the variable------->
>
> <cfset myquery = "Select *, CALLS.ID AS TICKET, DATENAME(MM, CALLDATE) + '
'
> + DATENAME(DD, CALLDATE) + ', ' + DATENAME(YYYY, CALLDATE)AS 'DATEOFCALL',
> DATENAME(MM, LASTUPDATE) + ' ' + DATENAME(DD, LASTUPDATE) + ', ' +
> DATENAME(YYYY, LASTUPDATE)AS 'LU', Ext, ExternalEmail, LastName + ', ' +
> FirstName AS FullName from CALLS, Employees WHERE ">
>
> <cfif closed IS NOT "">
> <cfset myquery = myquery & "CLOSED = '" & #CLOSED# & "'">
> </cfif>
>
> <cfif useridconj IS NOT "">
> <cfif closed IS NOT "">
> <cfset myquery = myquery & " " & #useridconj#>
> </cfif>
> <cfset myquery = myquery & " CALLS.NAME = " & #NameID#>
> </cfif>
>
> <cfif techconj IS NOT "">
> <cfif nameid IS NOT "">
> <cfset myquery = myquery & " " & #useridconj#>
> </cfif>
> <cfset myquery = myquery & " " & #techconj# & " CALLS.TECH = '" & #TECH#
&
> "'">
> </cfif>
>
> <cfif calldatestart IS NOT "">
> <cfset myquery = myquery & " " & #calldatefromconj# & " CALLS.CALLDATE >=
"
> & #CallDateStart#>
> </cfif>
>
> <cfif calldatethru IS NOT "">
> <cfset myquery = myquery & " AND CALLS.CALLDATE <= " & #CallDatethru#>
> </cfif>
>
> <cfif category IS NOT "">
> <cfset myquery = myquery & " " & #categoryconj# & " CALLS.CATEGORY = '" &
> #CATEGORY# & "'"></cfif>
>
> <cfif enteredby IS NOT "">
> <cfset myquery = myquery & " " & #enteredbyconj# & " CALLS.ENTEREDBY = '"
&
> #ENTEREDBY# & "'"></cfif>
>
> <cfif callmethod IS NOT "">
> <cfset myquery = myquery & " " & #callmethodconj# & " CALLS.CALLMETHOD =
'"
> & #CALLMETHOD# & "'"></cfif>
>
> <cfif Office IS NOT "">
> <cfset myquery = myquery & " " & #Officeconj# & " Employees.Office = '" &
> #Office# & "'"></cfif>
>
> <cfif CallDescWords IS NOT "">
> <cfset myquery = myquery & " " & #descwordsconj# & " Calls.Issue like
'"
> & #CallDescWords# & "'"></cfif>
>
> <cfif CallNotesWords IS NOT "">
> <cfset myquery = myquery & " " & #noteswordsconj# & " Calls.Notes like
'"
> & #CallNotesWords# & "'"></cfif>
>
> <cfif CallResolutionWords IS NOT "">
> <cfset myquery = myquery & " " & #resolutionwordsconj# & "
> Calls.Resolution like '" & #CallResolutionWords# & "'"></cfif>
>
>
> <-----Here's the query I try to use------->
>
> <cfquery datasource="firmdaily" name="GetMyQueryResults">
> <cfoutput>#myquery#</cfoutput>
> </cfquery>
>
> <-----Here's the output I try to display------>
>
> <cfoutput query="GetMyQueryResults">
> <tr>
> <td>#Ticket#</td>
> <td><a href=" #FullName# <mailto:#ExternalEmail#>
> mailto:#ExternalEmail#">#FullName#</a></td>
> <td>#Ext#</td>
> <td><a href=" #Tech# <mailto:#Tech#> mailto:#Tech#">#Tech#</a></td>
> <td>#DateOfCall#</td>
> <td>#LU#</td>
> <td><a
> href="MonitorEdit.cfm?ID=#CallsQry.Ticket#&OLDTECH=#TECH#">Edit</a><BR>
> <a href="MonitorClose.cfm?ID=#Ticket#&OLDTECH=#TECH#">Close</a><BR>
> <a href="MonitorViewNotes.cfm?ID=#Ticket#">Notes</a></td>
> <td>#Issue#</td>
> <td>#Category#</td>
> <td>#Office#</td>
> </tr>
> </cfoutput>
>
> <---------Here's the lovely error message I receive--------->
>
> ODBC Error Code = 37000 (Syntax error or access violation)
>
>
>
> [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot use empty object or
> column names. Use a single space if necessary.
>
>
>
>
> The error occurred while processing an element with a general identifier
of
> (CFQUERY), occupying document position (64:1) to (64:57).
>
>
> Date/Time: 09/17/02 15:04:06
> Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Hotbar
4.1.5.0)
> Remote Address: 10.30.25.134
> HTTP Referrer: http://dailynews/helpdesk/monitorqbe.cfm
> <http://dailynews/helpdesk/monitorqbe.cfm>
>
>
>
> Does anyone have any ideas on a better way for me to generate my output?
> This is a Query By Example application.
>
>
>
> Thanks,
>
> Aimee Clark
> Web Developer
> Stinson Morrison Hecker LLP
> 816-691-3461
> [EMAIL PROTECTED]
>
>
> _____
>
>
>
<http://promos.hotbar.com/promos/promodll.dll?RunPromo&El=hotbar%5felement%3
> bst%3b&SG=&RAND=9320> <http://skins.hotbar.com/Skins/promo/1px/1px.gif>
>
>
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
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