Subject | Re: [ib-support] COMPUTED FIELD BY SUBTRACTING TWO TIME FIELDS |
---|---|
Author | Ali Gokcen |
Post date | 2001-01-28T19:23:11Z |
Arnoldo,
sorry me about my shortcut
expression,
i like to show how catch it instead of
to give ready fish. ;)
CREATE TABLE
TIMEDELTA
(
T1 TIME, // start time
T2 TIME, // stop time
DELTA_HM COMPUTED BY ( CAST('00:00:00' as time) + (t2-t1)) // delta as HH:MM:SS
);
(
T1 TIME, // start time
T2 TIME, // stop time
DELTA_HM COMPUTED BY ( CAST('00:00:00' as time) + (t2-t1)) // delta as HH:MM:SS
);
you can use like my ex. above. SP will inc.
your apps complexty.
good luck.
----- Original Message -----From: ArnaldoSent: Sunday, January 28, 2001 8:36 PMSubject: R: [ib-support] COMPUTED FIELD BY SUBTRACTING TWO TIME FIELDSSolved. Thanks to Ali Gokcen.Your reply is a full understand to me.this line:select cast('00:00' as time) + (cast('12:22' as time) - cast('10:20' as time)) from rdb$database;seems don't work in computed fields so I have set up a Stored Procedure and seem all woks fine.again thanks Ali.Arnaldo----- Original Message -----From: Ali GokcenSent: Sunday, January 28, 2001 2:48 PMSubject: Re: [ib-support] COMPUTED FIELD BY SUBTRACTING TWO TIME FIELDSselect cast('00:00' as time) + (cast('12:22' as time) - cast('10:20' as time)) from rdb$database;it works.but,cast( cast('12:22' as time) - cast('10:20' as time) as time) not.its returning seconds. so, you can calculate it yourself too(firsttime-secondtime )/3600 is hour,(int) (((firstime-secondtime)-(int(hour) * 3600) ) / 60) is minute..----- Original Message -----From: ArnaldoSent: Sunday, January 28, 2001 10:43 AMSubject: [ib-support] COMPUTED FIELD BY SUBTRACTING TWO TIME FIELDSHi all.There is a way to subtract two fields ot type TIME in a computed fields?I have 2 fields say: 'FIRSTHOUR' and a second 'SECONDHOUR':if i do:WHOUR = COMPUTED BY ( SECONDHOUR - FIRSTHOUR ) but i got a COMPUTED numeric field:HOW EXTRACT TIME FROM THIS FIELD???THANKSArnaldo
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com