469,927 Members | 1,946 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Cast decimal point for the division of 2 decimal fields

2
Hi, when I divide Sum (AMT_NET_GAAP_GNLS)/Sum (AMT_UPB_FM) and these two fields are decimal fields, the results is 0

I know there is a way to cast the decimal point but i keep on getting errors,
How do I cast decimal (14,13) for the result of
Sum (AMT_NET_GAAP_GNLS)/Sum (AMT_UPB_FM) ?



select
Sum (AMT_NET_GAAP_GNLS)/Sum (AMT_UPB_FM)
from udbadm.mol_cl_closd_hst
Where dt_sts_closd between '08/01/2006' and '08/31/2006' and date (dt_srce_end) = '01-01-9999'
and flag_del <>'Y'and cd_mrtg_ls_type = 'REO'
GROUP BY CD_FM_RGN, ind_unit
Oct 28 '06 #1
1 5914
ronverdonk
4,258 Expert 4TB
I don't see why the decimals are cut off, but what about using the FORMAT()? As in
Expand|Select|Wrap|Line Numbers
  1. SELECT FORMAT(0.0004 / 0.0123, 10)
Ronald :cool:
Oct 28 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

18 posts views Thread by Graham Nicholls | last post: by
21 posts views Thread by Batista, Facundo | last post: by
7 posts views Thread by hana1 | last post: by
687 posts views Thread by cody | last post: by
9 posts views Thread by Nicolas Blais | last post: by
8 posts views Thread by Byte | last post: by
12 posts views Thread by Frank Millman | last post: by
13 posts views Thread by =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.