<cfif arguments.asking1 neq "" and arguments.asking2 eq ""> price = #ARGUMENTS.asking1#, <cfelseif arguments.asking1 eq "" and arguments.asking2 neq ""> price = #ARGUMENTS.asking2#, <cfelse> price = NULL, </cfif>
Andrew Scott Senior Coldfusion Developer Aegeon Pty. Ltd. www.aegeon.com.au Phone: +613 8676 4223 Mobile: 0404 998 273 -----Original Message----- From: Doug Brown [mailto:[EMAIL PROTECTED] Sent: Friday, 22 December 2006 11:16 AM To: CF-Talk Subject: <CFIF>? I am having some troubles with an if statement and cannot seem to get it right. I have 2 text fields that hold the value of the price of items a user is selling, a user can fill in either one of the fields or none at all. If the user chooses not to fill in these fields, then I want to add a default value of 0 to the price in the database. I am using this so far with not luck. I tried using <CFELSEIF> with no luck either. In the below code, I will get two price objects due to one or both fields being empty. <cfif arguments.asking1 IS NOT ""> price = #ARGUMENTS.asking1#, </cfif> <cfif arguments.asking2 IS NOT ""> price = #ARGUMENTS.asking2#, </cfif> <cfif arguments.asking1 IS "" AND arguments.asking2 IS ""> price = NULL, </cfif> Doug B. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264858 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

