Subject | Re: [firebird-support] trunc udf missing? |
---|---|
Author | Francesco Lamonica |
Post date | 2007-03-29T18:44:24Z |
On 3/29/07, Richard Wesley <hawkfish@...> wrote:
TRUNCATE
[Non-text portions of this message have been removed]
>Unfortunately... it didn't help as i got the very same errors for FLOOR and
>
> 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,
> .
>
> __,_.
>
TRUNCATE
[Non-text portions of this message have been removed]