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
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to