Hi,

Bit confused on the placement of AND & OR operators in the same query.

<cfquery cachedwithin="#createtimespan(0,0,10,0)#" name="getads"
datasource="#DSN#">
SELECT left(subject,20) as newsubject, * FROM advert_details
WHERE town = '#form.towny#'
OR (natpaid = Yes AND nationwide = Yes)

<cfif isdefined('form.category')>

AND category = '#form.category#'
</cfif>
</cfquery>

Before form.category is defined, the query works as I want it to.  But once
form.category is defined, will the addition of an AND operator muck up the
query?

Thanks

Will
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
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

Reply via email to