Hello, it's me again,
I am trying to replace an IF statement with a CASE statement, but it looks to me like the WHEN is not recognized by the myDBR interpreter (it is not highlighted), and I get an error message.
Here is my code:
/* Customize bar colors */
select
'dbr.chart.options',
'label_color',
event_datetime,
/* if (event_type='Ignition On', '0x42B64A', '0xE85854') */
CASE event_type
WHEN 'Ignition On' THEN '0x42B64A'
WHEN 'Ignition Off' THEN '0xE85854'
END CASE
from
rkhydro_gpsdata.asset_event_datetime_elapsed_event_type_temp_table;
Here is the error message:
syntax to use near 'CASE from rkhydro_gpsdata.asset_event_datetime_elapsed_event_type_t' at line 29
Thank in advance,
Mike