Re: CONVERT DECIMAL rounding
== Quote from dkruger (davidkruger@techie.com)'s article
> Hi Everyone,
> I am having a problem with mysql, when using convert. I have version
> 5.0.45 of mysql, the problem I am having is if I run a query as
> follows, after the insert queries:
> insert into testing (value,value2) values ('3.68','7.22');
> insert into testing (value,value2) values ('1.21','5.79');
> select convert(value,DECIMAL),convert(value2,DECIMAL) FROM testing;
> I get the following, where I would expect to get the same values that
> were entered with the insert query commands:
> +------------------------+-------------------------+
> | convert(value,DECIMAL) | convert(value2,DECIMAL) |
> +------------------------+-------------------------+
> | 1 | 6 |
> | 4 | 7 |
> +------------------------+-------------------------+
> 2 rows in set (0.00 sec)
> I am having this problem after moving the production database to this
> new server, where the old was not rounding the values to the nearest
> integer.
> Could anyone give me some assistance to what might be the cause? I am
> not very familiar with configuring MySQL, but have full access to the
> configuration files etc.
> Thanks,
> David
post a description of the table. run this from cmd line:
desc tablename;
and post the results.
--
POST BY: lark with PHP News Reader ;o)
|