Subject Re: [firebird-support] trunc udf missing?
Author jft
Francesco,
Try subtracting 0.5 before rounding up ...
cast ((current_timestamp - starttime) * 60 * 24 /3 - 0.5 as integer)
John

> -------Original Message-------
> From: Francesco Lamonica <AlienPenguin@...>
> Subject: [firebird-support] trunc udf missing?
> Sent: 30 Mar '07 03:26
>
> 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?
>
> it happened on gentoo (firebird superserver 1.5.3-r1)
> and on debian (fb superserver 2.0)
>
> as a side note: i had many many problems trying to connect via jaybird
> (or
> any other means like flamerobin) to a classic server via tcp is that a
> known
> issue? (that happened on both fb2.0 (debian) that fb1.5.3 on gentoo).
> When
> switched to SS all connection worked like charm.
>
> thanks
>
> [Non-text portions of this message have been removed]
>
>