Subject Re: The integer part of a number
Author Adam
--- In firebird-support@yahoogroups.com, news@... wrote:
>
> Hi,
>
> I am looking for a way to get the integer part of
> a number in a stored procedure.
>
> Example:
> There is a given number, eg. 1.997260274.
> In this case, I want to have "1" returned.
>
> I thought this was a trivial problem, but I have no
> clue how to solve this with Firebird 1.5.

The SQL standard defines that when casting between a numeric and an
integer the value should round down.

So

cast(SomeNumeric as Integer)

should return exactly what you want.

Adam