|Subject||RE: [firebird-support] sum and time fields|
> Thanks Helen and thanks Alan for your answers,as long as the durations are less than 24 hours it will read OK. > 24 hours
> 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 ?
and it will wrap and you loose the days part
> 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.