As others already pointed out - different months have different number of days. So in general it is not possible to tell how many months 61 days is. In your case you need to use combination of unpaid leave start date and number of days. So, for example if unpaid leave started February 1, 2013 and lasted 61 days, then it would be 2 months and 2 days. And if it started July 1, 2013 then it would be 1 month and 30 days.
Thanks Etbin and Solomon for the reply.
It is sum of all the unpaid leaves taken by the employee in his service, So we need to sum all the total days as 61 days and then I need to show it as months,days as described above.
Let me test tomorrow in office the query sent by Etbin and will update you all here...
Thanks a lot once again to all of you .................... : )
You could act as a some kind of astronomer: Year - Wikipedia, the free encyclopedia
select :days input,
floor(:days / 365.25) years,
floor(mod(:days,365.25) / (365.25 / 12)) months,
ceil(mod(:days,365.25 / 12)) days
but dont be surprised
maybe next version looks better
floor(days / 365.25) years,
floor(mod(days,365.25) / (365.25 / 12)) months,
round(mod(days,365.25 / 12)) days