Actually, it might be a bit cleaner to use the ListQualify function instead of Replace:
listQualify(form.propertyType,"'") ----- Original Message ----- From: "C. Hatton Humphrey" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 11:15 AM Subject: RE: RE: Using CFmail and loops > Stephen, > > You should be able to re-work your query to use the in function (where > PropertyType IN ('#replace(form.propertytype, ",", "','", "ALL")#'). > > Also, you might try building a pseudo grouping into your loop inside the > cfmail and take out the query parameter of the cfmail tag.... assuming that > you only want one email generated per serarch, right? > > Hatton > > > <cfloop index="PType" list="#FORM.PropertyType#" delimiters=","> > > > > <cfquery name="SearchProperties" datasource="CMSX"> > > > > > > SELECT PropertyID, > > FullJobName, > > PropertyType, > > Tenure > > FROM Properties > > WHERE PropertyType = '#FORM.PropertyType#' > > > > <cfif IsDefined("FORM.PropertyInfo")> > > > > <cfif FORM.PropertyInfo NEQ > > "Freehold,Leasehold"> > > > > AND Tenure = > > '#FORM.PropertyInfo#' > > > > </cfif> > > > > </cfif> > > > > AND OnPrintedList = 1 > > ORDER BY PropertyType, > > FullJobName, > > Tenure > > > > > > > > </cfquery> > > > > <cfmail query="SearchProperties" > > to="[EMAIL PROTECTED]" > > from="[EMAIL PROTECTED]" > > server="mail.company.com" > > port=25 > > timeout=20 > > type="HTML"> > > > > <cfloop query="SearchProperties"> > > > > <cfoutput> > > <p> > > <table> > > > > <tr><td>#SearchProperties.FullJobName#</td></tr> > > > > <tr><td>#SearchProperties.PropertyType#</td></tr> > > > > <tr><td>#SearchProperties.Tenure#</td></tr> > > </table> > > </p> > > <hr> > > </cfoutput> > > > > </cfloop> > > > > > > </cfmail> > > > > </cfloop> > > > > Hope this helps, > > > > Cheers Stephen > > > > > > > > > > > ______________________________________________________________________ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists