5

I have a date column and a time column and I'd like to make a datetime/timestamp.

I've tried

Date+Time

but I get:

SQL compilation error: error line 4 at position 14 Invalid argument types for function '+': (DATE, TIME(9))

Neil P
  • 2,920
  • 5
  • 33
  • 64

1 Answers1

9

You can use TIMESTAMP_NTZ_FROM_PARTS(date, time), e.g.

select timestamp_ntz_from_parts('2013-04-05'::date, '01:02:03.12345'::time);
----------------------------------------------------------------------+
 TIMESTAMP_NTZ_FROM_PARTS('2013-04-05'::DATE, '01:02:03.12345'::TIME) |
----------------------------------------------------------------------+
 2013-04-05 01:02:03.123450000                                        |
----------------------------------------------------------------------+
Marcin Zukowski
  • 4,281
  • 1
  • 19
  • 28