2067663 - Understanding ROUND function in SAP IQ | SAP Knowledge Base Article

SAP Knowledge Base Article - Preview

2067663 - Understanding ROUND function in SAP IQ

Symptom

  • Results of using function ROUND seems to be not always as expected.
    In this query one value seems to be rounded properly and the other one seems to be truncated, not rounded. Why ?

drop table if exists tbl;
--
create table tbl(clmn double);
--
insert into tbl(clmn) values (0.9559);
insert into tbl(clmn) values (143.4753);
--
select clmn  --
, convert(numeric(22,17),clmn) as clmn_expanded  -- returns type numeric(22,17) to make true stored value fully visible
, round(clmn, 2) as round_to_2dec  --
, round(clmn, 2)*100 as round_to_2dec_mult_100  --
, cast (round(clmn, 2)*100 as integer) as round_to_2dec_mult_100_as_INT
--
from tbl;

result_1_kba_2066574.png 


Read more...

Product

SAP IQ 16.0 ; SAP Sybase IQ 15.2 ; SAP Sybase IQ 15.4

Keywords

round, cast, convert, wrong result, accuracy, different result. , KBA , BC-SYB-IQ , Sybase IQ , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.