Reputation: 7568
In a db2
database I have a DATE
column and a TIME
column, how can you combine these into a single TIMESTAMP
?
Upvotes: 16
Views: 34867
Reputation: 7568
As per this thread, the [TIMESTAMP][2]
function can accept 2 parameters, so you can simply pass it the DATE
and TIME
components and it constructs the TIMESTAMP
for you.
SELECT MyDate,
MyTime,
TIMESTAMP(MyDate, MyTime) AS MyTimestamp
FROM MyTable
Upvotes: 2
Reputation:
The timestamp
function can be called with two arguments, one of which is date and one of which is time:
select timestamp(date_col,time_col) from your_table
Upvotes: 34