SELECT EXTRACT(DAY FROM LAST_DAY(SYSDATE)) num_of_days FROM dual;
/
SELECT SYSDATE, TO_CHAR(LAST_DAY(SYSDATE), 'DD') num_of_days FROM dual
/
-- Days left in a month --
SELECT SYSDATE, LAST_DAY(SYSDATE) "Last", LAST_DAY(SYSDATE) - SYSDATE "Days left"
FROM DUAL
/
---- Crystal Report
---- Function
if (month(cdate({?Month(Ex:June-2019)})) in [1,3,5,7,8,10,12]) then
31
else if (month(cdate({?Month(Ex:June-2019)})) in [4,6,9,11]) then
30
else if (month(cdate({?Month(Ex:June-2019)})) = 2 and remainder(year(cdate({?Month(Ex:June-2019)})),2) = 0) then
29
else
28
------
{EMP_SALARY_SHEET\\.GROSS_SALARY}/( if (month(today) in [1,3,5,7,8,10,12]) then 31 else if (month(today) in [4,6,9,11]) then 30 else if (month(today) = 2 and remainder(year(today),2) = 0) then 29 else 28 )*{EMP_SALARY_SHEET\\.ABSENT_DAYS}
No comments:
Post a Comment