|
|
Archives of the TeradataForum
Message Posted: Fri, 24 Oct 2003 @ 20:39:46 GMT
Subj: | | Re: Concatenate DATE and TIME(6) columns into Timestamp column |
|
From: | | Dieter Noeth |
Ganga Palakattil wrote:
| Is there a way to concatenate DATE and TIME(6) columns into TIMESATMP column. Then I need to do arithmetic on two different TIMESTAMP
columns thus created on a dynamic view. | |
The most efficient way is to cast the date to a timestamp and add the
time. But you can't simply add a time, because TIME is a point in time
and no duration. So you have to transform it into an interval:
cast(Date_column as TimeStamp(6))
+ ((Time_column - time '00:00:00') hour to second(6))
Dieter
| |