Subject Re: [firebird-support] trunc udf missing?
Author Richard Wesley
On Mar 29, 2007, at 10:25, Francesco Lamonica 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)
>
> i dont get the result i want since when division ends to be 1.50
> minutes it
> rounds it to 2
>
> i tried
>
> trunc((current_timestamp - starttime) * 60 * 24 /3) but i get the
> following
> error
>
> -SQL error code = -804
> -Function unknown
> -TRUNC
>
>
> same goes for "round"
>
> so maybe i am not seeing udf's?

F_TRUNCATE from FreeAdHocUDF should do what you want. There is also
a FLOOR function and a TRUNCATE function that ship with FB, but I
think I found them to be a bit picky about their argument types.

HTH,
________________________________________________________
Richard Wesley Senior Software Developer Tableau
Software
(w) +1-206-633-3400x505
hawkfish@...
Visit: http://www.trytableau.com/now.html