Hi Friends,
Im using Forms 6i when i am try to using this query im getting compilation error.
Select
x.emplcode,
case when cb_cl > 0 then 7 else cb_cl+7 end cbcl,
cb_sl+7 cbsl,
cb_pl+crpl cbpl
from (Select a.Emplcode,
Cb_Cl,
Cb_Sl,
Cb_Pl,
a.Unitid
FROM EMPL_LEAVE_CARD a,emplmast b
WHERE MONTHNO = 12
AND YEARNO = 2007
And a.Unitid = 1
and a.emplcode = b.emplcode
and substr(catgcode,1,1) not in ('W','A','T')
and empstatus not in ('L','D','V')) x,
(select emplcode,
Least(trunc(present,-1)/20,14) crpl
from (Select a.emplcode,
sum(presentdays)+sum(compoffdays) present
from attendance a,emplmast b
where yearno = 2007
and a.emplcode = b.emplcode
and b.empstatus not in ('L','D','V')
and substr(catgcode,1,1) not in ('W','A','T')
and a.unitid = 1
group by A.emplcode,yearno)) y
where x.emplcode = y.emplcode
wbr
kanish