title: SQL Command Not Properly Ended
body: <pre><code>SELECT SUM(nvl(DYRCVDWT, 0)) + SUM(nvl(RCVDWT, 0)) + SUM(nvl(rcvdafpwt, 0)) - SUM(nvl(retdwt, 0)) INTO netwt
  FROM YARNLEDGER yl
  (SELECT D.PROFILECODE, MAX(CLOSINGDATE)SDATE FROM PARTYSTOCKCLOSING D WHERE D.DEPT = 'Y' AND NVL(D.POSTED, 'N') = 'Y' GROUP BY D.PROFILECODE) SAD
  WHERE yl.PROFILECODE = :PROFILECODE 
  
  AND Yl.PROFILECODE = SAD.PROFILECODE(+)
  AND Yl.DOCUMENTDATE&gt;SAD.SDATE 
  </code></pre>