Subject Re: [firebird-support] sum and time fields
Author Redlet
Thanks Helen and thanks Alan for your answers,

Helen suggested :

> select phone_number, sum(end_time - start_time) as Total_duration
> from phone_calls
> group by phone_number
> where ...

Perhaps something like :

select phone_number, sum(duration - cast('00:00:00' as time)) as
from phone_calls
group by phone_number
where ...

What do you think of this ?

It seems it is correct for Firebird 1.5 (I mean there is no error
message and the result is what I expect) but I'm not sure what the type
of the result is. When I execute the SQL script with IBConsole which
comes with Delphi, it works fine, but when I try to get the field
total_duration value in a FreePascal Integer variable, FreePascal talks
about a conversion error.

Thanks again for your precious help.

Best regards.