val() command <cfset SESSION.ecom.ordernumber = val(qLastOrderNo.newOrderNumber) + 1>
-- Sam -----Original Message----- From: Mark Leder [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 12:49 PM To: CF-Talk Subject: Convert format Hi All, I've got a query which retrieves the max order number from the db. I want to increment it by one and write the new number to a session var. However, CF5 throws a message that it can't convert format. I checked the db (SQL 2000)- the field ordernumber is an integer. What am I doing wrong? (here's the snip) ------------------------------------ <!--- Create an order number ---> <!--- Query the orders database for the last order number ---> <cfquery name="qLastOrderNo" dbtype="dynamic" connectstring="#REQUEST.dsnStore#"> SELECT MAX(ordernumber) AS newOrderNumber FROM #REQUEST.tablePrefix#_O_OrderInfo </cfquery> <cflock name="VASPCart#SESSION.SessionID#" timeout="10" type="exclusive"> <cfif qLastOrderNo.recordcount IS "0"> <cfset SESSION.ecom.ordernumber="7500"> <cfelse> <cfset SESSION.ecom.ordernumber= #qLastOrderNo.newOrderNumber# + 1> </cfif> </cflock> ------------------------------------ Thanks, Mark ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

