All Forums Database
bala2121 10 posts Joined 05/13
03 May 2013
Using FLOOR() function over a Bigint Columns

Hi All,
I have a 13 digit Bigint column value 1734567890123 being divided by 1000000000000 and I need the result to be displayed as 1. But i am getting 2 as a result in Td V14.0. I cannot make use of the FLOOR() function also which is returning the same result 2
SEL 1734567890123/1000000000000 as Result
Ans :
But when i try with a normal integer value say 49/10 the result  is 4 only.  Please suggest any possible solutions.

dnoeth 4628 posts Joined 11/04
03 May 2013

When you got BIGINTs the result should be 1.
Looks like you actually got DECIMALs.

SEL TYPE(1734567890123), TYPE(1000000000000);
SEL CAST(1734567890123 AS BIGINT)/CAST(1000000000000 AS BIGINT);



bala2121 10 posts Joined 05/13
05 May 2013

Thanks Dieter for your timely response. Casting into Bigint works fine.

You must sign in to leave a comment.