Beilstwh, yours doesnt work either...you are missing "end" hehee, but I got it working.
Thanks for ur post.
SELECT
QATECH_DATASTORE."cust_trucks"."truck_name",
"a"."date_time",
"a"."speed",
"a"."heading",
trunc("a"."date_time") as THEDAY,
(case
when "a"."heading" <...