Bill,

You don't need the CFSET
(Is Availability numeric?  If so, ditch the single quotes)
Also, you might put a % after the variable in case somebody abbreviates:


 <CFQUERY NAME="search" Datasource="sqft">
        SELECT * from property
        WHERE City LIKE '#city#%'
                    or State LIKE '#state#%'
                    or Availability = '#SquareFeet#'
</CFQUERY>


Dave


----- Original Message -----
From: Bill Kaigler <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 17, 2000 3:44 PM
Subject: dynamic query


> Hi,
>
> I am trying something which may not be allowed.
>
> <cfset test = "where (City LIKE '#city#'
> or State LIKE '#state#'
> or Availability >= '#SquareFeet#')">
>
> <CFQUERY NAME="search" Datasource="sqft">
> Select * from property
> #test#
> </CFQUERY>
>
> I am getting a 37000 syntax error.  I have tried this with and without the
> single quotes and it gets the same error.
>
> I find conditionals in the sql (as shown in both cold fusion books: Danesh
> and Forta) to be very difficult to maintain as well as read.
>
> thanks in advance
>
> --------------------------------------------------------------------------
----
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to