Your problem is that CFQUERY automatically takes any variable in a
CFQUERY and escapes the single quotes, replacing them with two single
quotes (not double quotes, btw).
You might be able to get away with replacing this line in your query:
(#cip_numb#)
with this line:
(#Evaluate("cip_numb")#)
That *MIGHT* cause it NOT to escape the quotes.
BUT... if I were you, I'd find a different way to do this, and I'm sure
you'll get many responses on the better ways to do it :)
Also...
> <cfif fice contains "all">
> <cfelse>
Dear god... don't do that! <CFIF NOT fice contains "all"> or
something like that (I've never used "contains" so I'm not sure exactly
the correct way of doing it, but you should never have any empty block
within a <CFIF> if you can avoid it.
- Rick
Wurst, Keith D. wrote:
> Here is the code. This is all in a cfloop....
>
> <cfset county = "0">
> <cfset cip_numb = "">
> <cfloop query="get_cip_num">
> <cfif county eq "0">
> <cfset cip_numb = "cip = #get_cip_num.cip_number#">
> <cfelse>
> <cfset cip_numb = "#cip_numb# or cip = #get_cip_num.cip_number#">
> </cfif>
> <cfset county = county + 1>
> </cfloop>
>
>
> <cfquery datasource="#datasource#" name="count1" dbtype="odbc">
> select count(prop_id) as count1 from vw_proposal_all where
> <cfif fice contains "all">
> <cfelse>
> <cfset fice_counter = 0 >
> (
> <cfloop list="#aList#" index="new_fice" delimiters=",">
> fice = #new_fice# <cfif fice_counter eq
> list_length><cfelse>or</cfif>
> <cfset fice_counter = fice_counter + 1>
> </cfloop>
> )
> and
> </cfif>
> application_date >= #from_date# and application_date <= #to_date# and
> (#cip_numb#)
> </cfquery>
>
> -----Original Message-----
> From: Raymond Camden [mailto:jedimaster@;macromedia.com]
> Sent: Tuesday, November 12, 2002 2:59 PM
> To: CF-Talk
> Subject: RE: Single quotes trouble...
>
>
> Ah- you are passing it to SQL? Can you show us all of your code?
>
> =======================================================================
> Raymond Camden, ColdFusion Jedi Master for Hire
>
> Email : [EMAIL PROTECTED]
> WWW : www.camdenfamily.com/morpheus
> Yahoo IM : morpheus
>
> "My ally is the Force, and a powerful ally it is." - Yoda
>
>
>>-----Original Message-----
>>From: Wurst, Keith D. [mailto:wurst@;rti.org]
>>Sent: Tuesday, November 12, 2002 2:55 PM
>>To: CF-Talk
>>Subject: RE: Single quotes trouble...
>>
>>
>>I've tried that and it's showing up as double quotes -
>>causing the sql query
>>to fail.
>>
>>-----Original Message-----
>>From: Scott Brady [mailto:cf_talk@;scottbrady.net]
>>Sent: Tuesday, November 12, 2002 2:50 PM
>>To: CF-Talk
>>Subject: Re: Single quotes trouble...
>>
>>
>>
>>><cfset cip_numb = "cip = #get_cip_num.cip_number#">
>>>
>>>I would like to put the single quotes around the
>>>#get_cip_num.cip_number#.
>>
>>If I understand the question, have you tried:
>>
>><cfset cip_numb = "cip = '#get_cip_num.cip_number#'">
>>
>>?
>>
>>Scott
>>
>>--------------------------------
>>Scott Brady
>>http://www.scottbrady.net/
>>
>>
>>
>>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm