Archives of the TeradataForum
Message Posted: Wed, 10 Dec 2003 @ 14:25:46 GMT
Subj: | | Re: Concatenating Dates with Times |
|
From: | | Dieter Noeth |
David Clough wrote:
| I seem to remember someone having an efficient method for combining a Date column and a Time column into a Timestamp column; one that
didn't involve Casting to Char and use of '||'. | |
cast(datecol as TimeStamp(2))
+ ((timecol - time '00:00:00') hour to second)
;
This uses about 5 times less CPU than
sel
cast(cast(datecol as char(10)) || ' ' ||
cast(timecol as char(..)) as TimeStamp(2))
Dieter
|