<cfquery name="Recordset" datasource="db1"> SELECT * From Sheet1 where
number = number <cfif myFname is not ""> AND fname like <cfqueryparam value="%#myFname#%" cfsqltype="CF_SQL_VARCHAR" maxlength="30"> </cfif> <cfif myLname is not ""> AND lname like <cfqueryparam value="%#Lname#%" cfsqltype="CF_SQL_VARCHAR" maxlength="30"> </cfif> <cfif myDepartment is not ""> AND dept like <cfqueryparam value="#myDepartment#" cfsqltype="CF_SQL_VARCHAR" maxlength="30"> </cfif> <cfif myType is not ""> AND type like <cfqueryparam value="#myType#" cfsqltype="CF_SQL_VARCHAR" maxlength="30"> </cfif> <cfif myOcbar is not ""> AND ocbar like <cfqueryparam value="%#myOcbar#%" cfsqltype="CF_SQL_VARCHAR" maxlength="30"> </cfif> <cfif myRadio is not ""> ORDER BY <cfqueryparam value="#myRadio#" cfsqltype="CF_SQL_VARCHAR" maxlength="30"> ASC </cfif> </cfquery> ________________________________ From: Charlie Arehart [mailto:[EMAIL PROTECTED] Sent: Monday, July 23, 2007 1:42 PM To: discussion@acfug.org Cc: Small, Lewis B. Subject: RE: [ACFUG Discuss] cfqueryparam in a sort Seth, it may help to show your SQL so we know for sure what you're asking. I can't see how using CFQUERYPARAM for the value of a WHERE clause would affect in any way an ability to SORT. Now, are you sorting in the same CFQUERY using the CFQUERYPARAM? Or might this be a Query of Query sort of that previous CFQUERY? /charlie ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tepfer, Seth Sent: Monday, July 23, 2007 12:28 PM To: discussion@acfug.org Cc: Small, Lewis B. Subject: [ACFUG Discuss] cfqueryparam in a sort We have an MSAccess db, and have a dynamic sort with cfqueryparam. When I use the actual field (fname), the query sorts correctly. When I use the cfqueryparam, it does not sort - even though the debug says the field fname was sent correctly. Does cfqueryparam make sort not work? Thanks seth ------------------------------------------------------------- Annual Sponsor FigLeaf Software - http://www.figleaf.com To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by http://www.fusionlink.com -------------------------------------------------------------