I have a simple SQL statement in which I want to grab a date field, and if one does not exist force a date into a virtual field. Here is an example:
select
table1.id,
table1.beg_date virt1
from
table1
union
select
table1.id,
"08/09/2002" virt1
from
table1
where
beg_date is null
(that is a very simplified version, but you get the idea). Anyway, when I try to run it, I get the following error:
"Corresponding column types must be compatible for each UNION statement. Error in line 9 Near character position 1"
"This is an Informix database by the way"
Does anyone know of a way to do this? I'm not sure why the columns are incompatible, the DATE field is in the format of MM/DD/YYYY. Anyone have any suggestions? Thanks!
select
table1.id,
table1.beg_date virt1
from
table1
union
select
table1.id,
"08/09/2002" virt1
from
table1
where
beg_date is null
(that is a very simplified version, but you get the idea). Anyway, when I try to run it, I get the following error:
"Corresponding column types must be compatible for each UNION statement. Error in line 9 Near character position 1"
"This is an Informix database by the way"
Does anyone know of a way to do this? I'm not sure why the columns are incompatible, the DATE field is in the format of MM/DD/YYYY. Anyone have any suggestions? Thanks!