Subject Re: Timestamp operations in stored procedure
Author willogibbo
Marek,

As an ordinary query, with timestamp columns LASTMODON and CREATEDON
this produced an integer value representing minutes:

select CAST(((LASTMODON - CREATEDON)*1440) AS INTEGER) as NEW_COL from
TABLENAME

Will


> Hello,
>
> Does somebody know how to substract one timestamp from the other in a
> stored procedure?
>
> We have variables:
> TIME_DIFF timestamp;
> TIME_START timestamp;
> TIME_STOP timestamp;
>
> and I would like to evaluate TIME_DIFF:
>
> TIME_START - not null value;
> TIME_STOP = 'now';
> TIME_DIFF = TIME_STOP-TIME_START;
>
> but such operation results an error:
>
> Error Message:
> ----------------------------------------
> Overflow occurred during data type conversion.
> conversion error from string "0.072731481".
>
> I know, that I'm suggested by Borland's TDateTime operations. I fact I
> thought TDateTime and TIMESTAMP types are very similar in physical
> structure.
>
> Regards,
>
> Marek Konitz