Using FLOOR() function over a Bigint Columns

Database

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 :

Result

2

But when i try with a normal integer value say 49/10 the result  is 4 only.  Please suggest any possible solutions.

Tags (3)
2 REPLIES
N/A

Re: Using FLOOR() function over a Bigint Columns

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);

Dieter

Re: Using FLOOR() function over a Bigint Columns

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

Regards,

Bala