On 23.1.2017. 15:44, Loon, Eric van (ITOPT3) - KLM wrote: > Hi TSM/SP-ers! > I have something weird when using te following SQL queries: > > select sum(fs_used_size),sum(fs_total_size) from sysibmadm.snapstorage_paths > > Unnamed[1] Unnamed[2] > --------------------- --------------------- > 74434565120 692060160000 > > Now, when I try to calculate a percentage, I get the following result: > > tsm: AMSE3>select cast(sum(fs_used_size)*100/sum(fs_total_size)as > decimal(3,1)) > from sysibmadm.snapstorage_paths > > Unnamed[1] > ---------- > 10.0 > > That is not correct, 74434565120 *100 / 692060160000 = 10.75... What am I > doing wrong here? > Thanks for any help in advance!
Missing FLOAT statement and greater DECIMAL range? select cast(FLOAT(sum(fs_used_size))*100/sum(fs_total_size)as decimal(4,2)) from sysibmadm.snapstorage_paths Regards, -- Sasa Drnjevic www.srce.unizg.hr > Kind regards, > Eric van Loon > Air France/KLM Storage Engineering > ******************************************************** > For information, services and offers, please visit our web site: > http://www.klm.com. This e-mail and any attachment may contain confidential > and privileged material intended for the addressee only. If you are not the > addressee, you are notified that no part of the e-mail or any attachment may > be disclosed, copied or distributed, and that any other action related to > this e-mail or attachment is strictly prohibited, and may be unlawful. If you > have received this e-mail by error, please notify the sender immediately by > return e-mail, and delete this message. > > Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its > employees shall not be liable for the incorrect or incomplete transmission of > this e-mail or any attachments, nor responsible for any delay in receipt. > Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch > Airlines) is registered in Amstelveen, The Netherlands, with registered > number 33014286 > ******************************************************** >