I am creating a VIEW using MySQL. There is one column that appears to be created fine. If I use the MySQL Query Browser to look at the data in the backend in this view, it looks correct. This is a DATETIME column and I see all datetimes except for a few rows were the column is NULL.
The View statement unions data from two tables. For this particular column the source fields in both tables are DATETIME. This has worked fine with Servoy, but I needed to add a case statement so now it is possible that this view’s column could have data from a third field. This field in servoy is also a DATETIME. However, when I create this view servoy shows that the column type is . How could this be? Is there anyway to force this column to be a DATETIME after the fact? I even tried using a cast statement to cast all 3 possible sources as DATETIME in the CREATE VIEW statement and even that does not work. The type of column remains . In case it helps here is the snippet I used for each table:
cast(useage
.date_used
as DATETIME) AS effective_date
and after the UNION in the second table:
(case when (line_item
.closed_flag
= 1)
then cast(receipt
.received
as DATETIME)
else cast(job_order
.plant_date
as DATETIME)
end)
AS effective_date
The joins with tables receipt and job_order work as expected and useage is the source table for the first part