>Why does this statement generate a "Cannot convert to number" error?
>
><CFQUERY name="getorderid" datasource="printprices">
>Select max(orderid) as orderID from purchases
></cfquery>
>
><CFIF getorderid.recordcount EQ 0>
><CFSET orderid=1001>
><CFELSE>
><CFSET orderid = getorderid.orderid + 1>
></CFIF>

Probably a stupid question, but have you dumped the query to see exactly 
what comes back? Is the orderID column a numeric value? You could also try 
putting a val() around the getorderid.orderid to make sure that whatever is 
returned is a numeric value, although you have to be careful because val() 
around a non-numeric value with be converted to 0.

Regards,
Dave.

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

Get the mailserver that powers this list at 
http://www.coolfusion.com

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

Reply via email to