|
|
Archives of the TeradataForum
Message Posted: Wed, 25 Aug 2004 @ 10:28:41 GMT
Subj: | | Re: Overflow error and time(0) |
|
From: | | Victor Sokovin |
| I need to extract time(0) from time stamp(6). The following query is giving me an error (time over flow), any suggestions ? | |
select
evt.created (date),
cast( evt.created as time(0) format 'HH:MM:SS' )
from
siebel.v_s_src s
join siebel.v_s_evt_act evt
on evt.src_id = s.row_id
Perhaps something along these lines?
BTEQ -- Enter your DBC/SQL request or BTEQ command:
sel cast(current_timestamp as CHAR(19) ) as C
, substr( C, 12, 8) as CTm
, cast( CTm as TIME(0) ) ;
sel cast(current_timestamp as CHAR(19) ) as C
, substr( C, 12, 8) as CTm
, cast( CTm as TIME(0) ) ;
*** Query completed. One row found. 3 columns returned.
*** Total elapsed time was 1 second.
C CTm CTm
------------------- -------- --------
2004-08-25 12:27:35 12:27:35 12:27:35
You can nest the functions in one expression, of course. I just separated them for readability.
Regards,
Victor
| |