That's something I would normally handle in my presentation layer but if you must do it this way then have a look at using
EXISTS[
^]
For example: (although you should probably invert this IF statement)
IF NOT EXISTS
(
SELECT emp.EMP_CODE
FROM dbo.EMP_FPONM_EMPLOYEE_INFORMATION emp
LEFT JOIN dbo.EMP_FPONM_EMP_TIME_SHEET et ON emp.EMP_CODE = et.EMP_CODE
WHERE EMP.SITE_ID = @SITE_ID
AND emp.DEPT_NAME = @DEPT_NAME
AND emp.STATUS = 'Present'
AND et.DAY = @d1
AND et.MONTH = @m1
AND et.YEAR = @y1
)
SELECT 0 as EMP_CODE, '' AS EMP_NAME, 0 AS Row, '0' AS G, '0' AS F, '0' AS S, '0' AS T
ELSE
END
As an aside, I sincerely hope that you are not storing numeric values in varchar fields :-)