Stored Procedure for finding the Leave days from working days

Create procedure [dbo].[CountTotalDays] ( @StartDate DATETIME = null, @EndDate DATETIME = null , @StartDatePresent varchar(10) = 'Full Day',--- Full Day or Half Day @EndDatePresent varchar(10) = 'Full Day' --- Full Day or Half Day --SET @StartDate = '2015/11/07' --SET @EndDate = '2015/11/14' ) as begin Select [Days] = (DATEDIFF(dd, @StartDate, @EndDate) + 1) -(DATEDIFF(wk, @StartDate, @EndDate)... Continue Reading →

Using Set Operators.

---- Using Set Operators. ---- Union, Union ALL, Intersect, Except drop table #Temp1 drop table #Temp2 Create table #Temp1 ( ID int , name varchar(50) ) Insert into #Temp1 Values(1,'AAA') Insert into #Temp1 Values(2,'BBB') Insert into #Temp1 Values(3,'CCC') Insert into #Temp1 Values(4,'GGG') Insert into #Temp1 Values(5,'MMM') Create table #Temp2 ( ID int , name varchar(50)... Continue Reading →

Find out the Leave day from Working Days.

To Find out the Leave day from Working Days. Here is mentioned in Example, Start date and End date is counted as Half Day / Full Day each Respectively. DECLARE @StartDate DATETIME, @Sday int , @Tday int DECLARE @EndDate DATETIME DECLARE @StartDatePresent varchar(10) = 'Half Day' --- Full Day or Half Day DECLARE @EndDatePresent varchar(10)... Continue Reading →

Create a free website or blog at WordPress.com.

Up ↑

Design a site like this with WordPress.com
Get started