Encountered the following error in PI OLEDB Tester while running a query using CASE:
“Cannot determine the result data type of the CASE or COALESCE function”
SELECT tag, time, CASE WHEN value < 0 THEN 0 ELSE value END FROM PIavg WHERE ...
Casting the 0 expression fixes this:
THEN CAST(0 AS float64)