|
|
Archives of the TeradataForum
Message Posted: Thu, 21 Dec 2006 @ 19:51:24 GMT
Subj: | | Re: Converting Time to seconds |
|
From: | | Dieter Noeth |
Anomy.Anom wrote:
| Can anyone suggest how to convert HH:MI:SS to seconds i.e. integer in Teradata. For example: 00:01:20 should be 80 seconds | |
SELECT
'00:01:20' (TIME(0)) AS xx,
EXTRACT(HOUR FROM xx) * 3600 +
EXTRACT(MINUTE FROM xx) * 60 +
EXTRACT(SECOND FROM xx) AS secs;
*** Query completed. One row found. 2 columns returned.
*** Total elapsed time was 1 second.
xx secs
-------- -----------
00:01:20 80
Dieter
| |