|
echo "scale=2; (10^6-1)/10^2" | bc9999.99
Joe Pluta wrote (about DB2 SQL) :
select decimal((10**6-1)/10**2,6,2) from sysibm/sysdummy1
You will not get 9999.99 as you would expect.
<snip>
P.S. As an aside, Excel gets this right, so it's not some mysticalcan't
issue
with 6,2 fields. I haven't tried it in SQL Server or MySQL, so I
say whether it's DB2 specific. I'd be interested to know.
mysql> select (1e6-1)/1e2 from dual;
+-------------+
| (1e6-1)/1e2 |
+-------------+
| 9999.99 |
+-------------+
1 row in set (0.00 sec)
Regarding M$SQL: Sorry, but life already has enough pain without
introducing SQL server to my little network. :) Maybe someone else
less fortunate than us may provide that answer.
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"It is difficult to produce a television documentary that is both
incisive and probing when every twelve minutes one is interrupted by
twelve dancing rabbits singing about toilet paper."
-- R. Serling
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.