Skip to content

A Quick Report / Column SQL expression meant to flag whether a part on a Maintenance Material Request also appears on an open Purchase Requisition throws a 'missing expression' error.

Answer

The issue is in how the correlated subquery references its comparison values — build the CASE expression using a correctly correlated subquery against the Purchase Requisition Line table instead, comparing on the part number consistently and without any malformed nested function-call syntax: something like CASE WHEN (SELECT COUNT(*) FROM <purchase_req_line_table> a WHERE a.part_no = PART_NO) > 0 THEN 'MMR' ELSE 'NO MMR' END, rather than nesting a differently-scoped subquery and an API call with inconsistent aliasing, which is what was producing the malformed SQL.

← Browse Reporting and analytics questions