Questions  /  Working with Data  /  SQL

How can I combine several string values/columns and convert them into a date?

Learn how to combine and convert several column values into a data with a PostgreSQL function.

In order to combine two or more string column or values and convert them into a date, it would be necessary to apply a SQL query similar to this one, thus using to_timestamp PostgreSQL function:

SELECT
  *, 
   to_timestamp(date_col || ' ' || hour_col, 'DD-MM-YYYY HH24-MI-SS') as date 
FROM
  table