Archives of the TeradataForum
Message Posted: Wed, 25 Jun 2003 @ 21:55:01 GMT
Subj: | | Re: String to Timestamp conversion |
|
From: | | Terry Stover |
No easy way, you'll have to parse out the date and time components using substring & position, cast them to the correct format,
concatenate them together and cast the result as timestamp(0). Here's a code snippet that merges separate date and time columns into a
timestamp. Parsing the source string is left as an exercise for the student ;-). IMHO, you're better off fixing the format in the source
system.
cast(cast(cast(logdate as format 'YYYY-MM-DD') as char(11)) || cast
(logtime as format '99:99:99') as timestamp(0))
Terry Stover
Levi Strauss & Co.
|