Subject Re: trunc udf missing?
Author Adam
--- In firebird-support@yahoogroups.com, "Francesco Lamonica"
<AlienPenguin@...> wrote:
>
> Hi, i have a query part of which is like
>
> (current_timestamp - starttime) * 60 * 24 /3
>
> starttime is TIMESTAMP
>
> what i want to know is how many minutes (group of 3 minutes
actually) passed
> since starttime
>
> if i try
>
> cast ((current_timestamp - starttime) * 60 * 24 /3 as integer)

A good trick is:

cast ((((current_timestamp - starttime) * 60 * 24 /3) - 0.5) as integer)

Otherwise, there is a floor function in ib_udf which ships with Firebird.

Adam