cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

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.

View Entire Topic
johnsmirnios
Product and Topic Expert
Product and Topic Expert

Try NULL instead of ''.

Former Member
0 Likes

Great. That did the trick. Much appreciated.