Subject Re: [firebird-support] Time calculation, with time response
Author Anderson Farias
Hi,


>How can I calculate an interval of time?
>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)

You can't. As others have said TIME is just a point in time, so it goes from 00:00:00 to 23:59:59. For time intervals you should use a *number* (integer or float, whatever fits better for you). Read SET's and others messages carefully.

1. there's no 32 hours in time, so you really want to sum NUM + NUM
2. again, samething as 1.

I personally like using INTEGER to hold intervals in minutes (I don't need seconds or miliseconds).

When needed, to add an interval (integer, float) to a time field you should have in mind that:

1 = 24 hours = 1440 minutes and so on...


HTH

Regards,
Anderson Farias


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