Subject | Re: [firebird-support] computed field in sql |
---|---|
Author | Ivan Prenosil |
Post date | 2004-09-02T20:14:06Z |
When you subtract two time values, the result is number of seconds
between them, expressed as Decimal(9,4).
(Time datatype is intended to hold time in day,
not time intervals)
Ivan
between them, expressed as Decimal(9,4).
(Time datatype is intended to hold time in day,
not time intervals)
Ivan
----- Original Message -----
From: "Planles" <planles@...>
To: "Firebird" <firebird-support@yahoogroups.com>
Sent: Thursday, September 02, 2004 8:51 PM
Subject: [firebird-support] computed field in sql
> Hi!
>
> I have a time_begin and time_end in table.
> I want to show the duration in a result.
>
> I read some time ago here in the group about computed field.
> Is it neccessary to create it in table, or is there any way to get the same
> result just in a sql statement.
>
> I tried this:
>
> select TIMES.*, TIMES.T_END - TIMES.T_BEGIN as CALC_DUR from TIMES
>
> and I expected, that there should be the result in CALC_DUR, but it seems,
> that I don't get a valid time as result.
>
> T_END and T_BEGIN are Time type fields.
>
> Is it possible to achive it with sql and how ?
>
>
> Regards,
> Primoz