I'm using the following SQL expression to fill a field in a report:
(select "inc_cat_1"."inc_cat_sc"
from "inc_cat"
as "inc_cat_1"
where "incident"."incident_id" = "act_reg"."incident_id"
and "act_reg"."cause_id" = "inc_cat_1"."inc_cat_id"
and "inc_cat_1"."inc_type" = 'c')
inc_cat_1 is an alias to table inc_cat. The annoying thing is that sometimes it returns the correct value and sometimes doesn't, returning null instead. Looking in the application the correct value is always there, but I can't see any reason why null would be returned.
(select "inc_cat_1"."inc_cat_sc"
from "inc_cat"
as "inc_cat_1"
where "incident"."incident_id" = "act_reg"."incident_id"
and "act_reg"."cause_id" = "inc_cat_1"."inc_cat_id"
and "inc_cat_1"."inc_type" = 'c')
inc_cat_1 is an alias to table inc_cat. The annoying thing is that sometimes it returns the correct value and sometimes doesn't, returning null instead. Looking in the application the correct value is always there, but I can't see any reason why null would be returned.