cancel
Showing results for 
Search instead for 
Did you mean: 

union and column data types

06-01-2011 5:32 PM
SAP Managed Tags
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.

Accepted Solutions (1)

Accepted Solutions (1)

johnsmirnios
Product and Topic Expert
Product and Topic Expert

Try NULL instead of ''.

Former Member
0 Likes

Great. That did the trick. Much appreciated.

Answers (0)