ADSM-L

Re: [ADSM-L] SQL calculation error

2017-01-23 10:59:53
Subject: Re: [ADSM-L] SQL calculation error
From: "Loon, Eric van (ITOPT3) - KLM" <Eric-van.Loon AT KLM DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Mon, 23 Jan 2017 15:58:31 +0000
Hi Sasa!
Thank you VERY much for your help!
Kind regards,
Eric van Loon
Air France/KLM Storage Engineering

-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On Behalf Of 
Sasa Drnjevic
Sent: maandag 23 januari 2017 15:57
To: ADSM-L AT VM.MARIST DOT EDU
Subject: Re: SQL calculation error

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
> ********************************************************
>
********************************************************
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
********************************************************
                        

<Prev in Thread] Current Thread [Next in Thread>