firebird - SQL Force show decimal values -


i'm using firebird database , trying following sql each time returns 0, instead of 0.61538 (etc).

select (count(myfield)/26) totalcount mytable 

now when remove /26, totalcount returns 16 should. when add divided 26 in, result shows 0, should show full decimal value of 0.615384... know why it's not returning full value? i've tried wrapping in cast((count(myfield)/26) double) totalcount still returns 0.

thank in advance suggestions!!!!

try:

select count(myfield/26.0) totalcount mytable 

or:

select count(cast(myfield double)/26) totalcount mytable 

not familiar firebird, in other implementations have cast/convert either numerator or denominator decimal before division, integer division returns integer value.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -