Here's what I'm using currently, and have used for years with MySQL 4.1. debit_amount = <cfqueryparam cfsqltype="cf_sql_decimal" value="#lsparsecurrency(form.debit_amount)#">
I run validation to make sure the input only contains numbers, a dollar sign, comma, or period... common elements for money. Then, I use the lsparsecurrency above to make sure the value is valid currency. Suggestions? Rick -----Original Message----- From: Barney Boisvert [mailto:[EMAIL PROTECTED] Sent: Sunday, September 30, 2007 2:11 PM To: CF-Talk Subject: Re: Trouble storing monetary values in MySQL 5 How about your CFQUERYPARAM tag? Are you using the right type? On 9/30/07, Rick Faircloth <[EMAIL PROTECTED]> wrote: > Hi, Barney... and thanks for the reply. > > I think I have my table set up as you describe. > > Here's the table information: > > -- Table "debits" DDL > > CREATE TABLE `debits` ( > `debit_id` int(11) NOT NULL auto_increment, > `debit_category_id` int(11) NOT NULL default '0', > `debit_name` varchar(50) default NULL, > `debit_amount` decimal(10,2) unsigned NOT NULL, > `debit_recipient` varchar(50) default NULL, > `debit_description` text, > `personal` tinyint(1) default NULL, > `debit_date` date default NULL, > `debit_time` time default NULL, > `debit_location` varchar(30) default NULL, > `contact_person` varchar(20) default NULL, > `contact_phone` varchar(20) default NULL, > `contact_email` varchar(50) default NULL, > `date_entered` timestamp NULL default '0000-00-00 00:00:00' on update > CURRENT_TIMESTAMP, > PRIMARY KEY (`debit_id`) > ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1; > > It's the "debit_amount" column that is of concern here... > > Ideas? > > Rick ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289820 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

