Get next NDays Birthdays of Employee - SQL SERVER

Declare @Days as Int

SET @Days = 15

Declare @ToDate as Date
Select @ToDate = DATEADD(d,@Days ,getDate())



Select * from
(
Select ID, EmployeeName, DateOfBirth, Cast(Format(DateOfBirth,'MM/dd/') + Convert(Varchar,year(getdate())) as Date) As NDOB   From pr.mastEmployee
) AllData
Where NDOB >= getDate()  and NDOB <= @ToDate



Comments

Popular posts from this blog

Shared / Static Class in vb.net/C#

Xamarin Forms : PopUp Page with RG.Plugins.Popup

Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard)