How to combine date and time into a timestamp in db2?

xan picture xan · Mar 1, 2013 · Viewed 27k times · Source

In a db2 database I have a DATE column and a TIME column, how can you combine these into a single TIMESTAMP?

Answer

user1919238 picture user1919238 · Mar 1, 2013

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