Subject Re: [firebird-support] Time calculation, with time response
Author Roberto Carlos
How can I calculate an interval of time?

For example:

1. '16:40:35' + '15:25:37' =  '32:16:12' (32 hours 16 minutes 37 seconds)

2. '166:40:50' - '6:20:30' = '160:20:20' (160 hours 20 minutes 20 seconds)

 

Thanks.

 

Roberto Carlos




Em 01:46, Helen Borrie   escreveu:






At 12:58 PM 10/11/2008, you wrote:
>How can I calculate this?
>
>Select
> time '15:00:0.000' - time '14:04:42.000',

this gives you a number (interval), not a time.

> cast('15:00:0.000' as time) - Cast('14:04:42.000' as time),

likewise this

> cast(3318.0000 as time),

You can't cast a number as time.

> cast(cast('15:00:0.000' as time) - Cast('14:04:42.000' as time) as time)

This gives a number as well (interval).

A TIME type is a *point in time" (time of day), not an interval of time. So your CAST here from a valid string literal ( cast('15:00:0.000' as time) ) will return a value of type TIME .

./heLen












[Non-text portions of this message have been removed]