Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

Flexible Criteria Search?

$
0
0

Greetings

 

I contsructed a form that allows the user to search up to five criteria:

 

Date range,

appraiser,

order status,

client

priority

 

I've attempted to set the action page:

 

<cfquery name="search_flexible_criteria" datasource="#Request.BaseDSN#">

SELECT order_ID, order_number, order_client_ID, order_rush_status_ID, main_orders.order_status_ID, order_appraiser_ID, order_create_date, order_property_street, order_property_city, client_ID, client_company, appraiser_ID, appraiser_fname, appraiser_lname, lookup_order_status.order_status_ID, order_status, rush_status_ID, rush_status

FROM  main_orders MO, lookup_clients LC, lookup_appraisers LA, lookup_order_status LS, lookup_rush_status LR

WHERE 1 = 1

 

<cfif IsDefined("Form.StartDate")>

<cfset Session.StartDate = "#CreateODBCDate(FORM.StartDate)#">

<cfset Session.EndDate = "#CreateODBCDate(FORM.EndDate)#">

AND (order_create_date BETWEEN #Session.StartDate# AND #Session.EndDate#)</cfif>

 

<cfif IsDefined("Form.order_client_ID") AND Form.order_client_ID NEQ 0>

 

AND    client_ID  = #Form.order_client_ID# </cfif>

 

<cfif IsDefined("Form.order_appraiser_ID") AND Form.order_appraiser_ID NEQ 0>

  AND  appraiser_ID  = #Form.order_appraiser_ID#</cfif>

 

 

<cfif IsDefined("Form.order_status_ID") AND Form.order_status_ID NEQ 0>

   AND   MO.order_status_ID = #Form.order_status_ID#

   </cfif>

  

<cfif IsDefined("Form.order_rush_status_ID") AND Form.order_rush_status_ID NEQ 0>

    AND  rush_status_ID = #Form.order_rush_status_ID#

    </cfif>

 

ORDER BY order_create_date DESC

 

</cfquery>  

 

The first error encountered is "AND  rush_status_ID = #Form.order_rush_status_ID#"

 

Not yet got this to work- any advice would be greatly appreciated.

 

Thanks

 

seasonedweb


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>