>Could you show the code? Just the where clause? Gladly. Note that I have marked with a double-dash (--) where the query is choking and where it ends. Again, if I remove the cfqueryparam, even on just one of the two conditions (doesn't matter which), the query works fine. It's when both are cfqueryparam'ed that it takes forever:
WHERE p.msa = <cfqueryparam value="#client.msa#" cfsqltype="CF_SQL_CHAR" maxlength="2"> AND p.sector = <cfqueryparam value="#client.sector#" cfsqltype="CF_SQL_CHAR" maxlength="3"> AND p.id = pd.id -- The next two conditions are where CF chokes when using cfqueryparam AND p.x_long >= <cfqueryparam value="#Subj.Long#" cfsqltype="CF_SQL_NUMERIC"> AND p.y_lat >= <cfqueryparam value="#Subj.Lat#" cfsqltype="CF_SQL_NUMERIC"> -- End Choke AND ((p.x_long != <cfqueryparam value="#Subj.Long#" cfsqltype="CF_SQL_NUMERIC">) OR (p.y_lat != <cfqueryparam value="#Subj.Lat#" cfsqltype="CF_SQL_NUMERIC">)) ORDER BY dist Thanks for your time, Dave. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ______________________________________________________________________ Dedicated Windows 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=coldfusiona 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