If I hard code the @access_cd variable I get the expected reply. What is the proper syntax for the declaration of @access_cd? On cloverleaf 6.2 .
Invalid sql statement: ‘declare @access_cd int
FROM RF_ORDER AS ro
INNER JOIN RF_SCHEDULED_EMMI AS rse
ON ro.ORDER_ID = rse.ORDER_ID
WHERE rse.ACCESS_CD = @access_cd;’.