Subject Re: [ib-support] sum( time fields)
Author Helen Borrie
At 03:01 PM 12-02-01 +0000, you wrote:
>Hi All.
>Sorry to post this argument another time, but...
>Now i got the decimal parts of the resulting hour in centesimal:
>3,30 is turn into 3,50
>This is the code thanks to Ann:
>sum( ( cast(presenze.orelavorate - cast( '0.00.00' as time ) as
>numeric(9,3) ) )/60/60 )
>give me 3,50.
>but I want 3,30. As usual
>How to tell to interbase to transform a centesimal time in
>sessagesimal one?

Create a UDF that accepts the value part, calculates the centimal part as seconds and returns a string which you can either a store in the table or calculate in DSQL.

However, I understood that you wanted to use this figure for accumulating elapsed time. Don't you need a numeric for that?


All for Open and Open for All
InterBase Developer Initiative ยท