I'm working on leave application, have to calculate number of leave days available, starting from Startdate to Enddate of a contract. Where an employee get 1 day leave after 17 days from startdate of contract. How do I calculate the leave days, that accrue every after 17 days by 1.
I'm using ASP and SQL Server 2000 (Query Analyzer)
ndindi22
Quote:
Originally Posted by ndindi22
Can someone plz help me.
I'm working on leave application, have to calculate number of leave days available, starting from Startdate to Enddate of a contract. Where an employee get 1 day leave after 17 days from startdate of contract. How do I calculate the leave days, that accrue every after 17 days by 1.
I'm using ASP and SQL Server 2000 (Query Analyzer)
ndindi22
get the datediff between startdate to getdate() in days...divide by 17...
select @.numberofleave = datediff(dd, StartDate, getdate())/17 from yourtable
No comments:
Post a Comment