<cffunction access="public" name="qry_ordersGet" output="no" returntype="query"> <cfargument name="orderKeyList" type="string" required="no" default=""> <cfargument name="personKeyList" type="string" required="no" default=""> <cfquery name="qry_ordersGet" datasource="#variables.datasource#"> SELECT o.tablePK ,o.tblPeopleFK ,o.createdOn ,o.shippingMethod ,o.itemSubTotal ,o.totalBeforeTax ,o.tax ,o.shippingCost ,o.total ,p.firstName + ' ' + p.lastName AS name
FROM #request.sqlObjectPrefix#tblOrders o INNER JOIN #request.sqlObjectPrefix#tblPeople p ON o.tblPeopleFK = p.tablePK WHERE 1 = 1 <cfif len(arguments.orderKeyList)> AND o.tablePK = <cfqueryparam value="#arguments.orderKeyList#" cfsqltype="CF_SQL_INTEGER" list="Yes"> </cfif> <cfif len(arguments.personKeyList)> AND o.tblPeopleFK = <cfqueryparam value="#arguments.personKeyList#" cfsqltype="CF_SQL_INTEGER" list="Yes"> </cfif> </cfquery> <cfreturn qry_ordersGet> </cffunction> -- Regards, chedder is bedder ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-community/message.cfm/messageid:370893 Subscription: http://www.houseoffusion.com/groups/cf-community/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-community/unsubscribe.cfm