Judah wrote:> Untested but should work:> > <cfquery name="getPhysicianRecords" datasource="#DSN#">> SELECT * FROM Contacts> WHERE Contacts.ContactType = 'Physician'> <cfif Len(form.field) AND StructKeyExists(form,form.field)>> AND Contacts.#FORM.Field# = '#Trim(form[form.field])#'> <cfelse>> 1 = 0> </cfelse>> ORDER BY Contacts.LastName> </cfquery> Showing my ignorance again, but it is already showing so why not. What does the 1 = 0 do? ~David _________________________________________________________________ Want to do more with Windows Live? Learn 10 hidden secrets from Jamie. http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312336 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4