cancel
Showing results for 
Search instead for 
Did you mean: 

union and column data types

Former Member
2,009

When using UNION I receive "Cannot convert '' to a timestamp" when I try to run something like this:

select [field1], [field2] from [table]

union

select [field1], '' from [second table];

Field1 is the same in both tables. In the first select statement field2 data type is timestamp but I don't want field2 pulled from the second select statement. Is there a way to cast or format field2 in the second statement to run in this instance?

Appreciate any assistance.

Accepted Solutions (1)

Accepted Solutions (1)

johnsmirnios
Employee
Employee

Try NULL instead of ''.

Former Member
0 Kudos

Great. That did the trick. Much appreciated.

Answers (0)