|
|
Archives of the TeradataForum
Message Posted: Fri, 05 May 2006 @ 12:48:47 GMT
Subj: | | Re: The duration of the backup |
|
From: | | Frank O Connor |
Hi
If you have the start date, start time, end date and end time, you could try something like below (or a variant):
select
(date-1 ) || ' ' || ('13:00:00' ) (timestamp(0)) (named strt)
, current_timestamp (timestamp, format 'yyyy-mm-ddbhh:mi:ss') (named now)
, (now-strt) day(4) to second as elapsed_time
, (extract(day from elapsed_time) * 24* 60)
+ (extract(hour from elapsed_time) * 3660)
+ (extract(minute from elapsed_time) * 60)
+ (extract(second from elapsed_time)) as elapsed_seconds
Hope this helps
Frank
| |