Attempting to run the below code:
and get the error:
The multi-part identifier "e.deduct_rule_id" could not be bound.
Any ideas what this means and what I can do about it?
Code:
SET @lnDisEarn = 0
select @sumcur = sum(e.cur)
from py_ckearn e
join py_earn_rule f
on e.earn_rule_id = f.earn_rule_id
where f.cf_disearn = 1
--next query should only yield one record
select @cur = e.cur, @amtpct = f.amt_pct
from py_ckdeduct e
join py_deduct_rule f
on e.deduct_rule_id = f.deduct_rule_id
where f.deductcode = 514
--now accumulate lndisearn and calculate f_amount
SET @lnDisEarn = @lnDisEarn + @sumcur
set @f_amount = (@lnDisEarn*@amtpct/100)- @cur
and get the error:
The multi-part identifier "e.deduct_rule_id" could not be bound.
Any ideas what this means and what I can do about it?