Select records of up coming birthday within 3 days in SQL Server

mukesh1
 
on Apr 12, 2022 02:44 AM
823 Views

pls help in sql query to find out whose birthday coming in within 3 days, means today, tomorrow and day after tomorrow.

like today date is 29/04/2022 and dateof birth is 01/05/2022.

DOB format is dd/MM/yyyy

Download FREE API for Word, Excel and PDF in ASP.Net: Download
dharmendr
 
on Apr 12, 2022 07:07 AM

Use Where condition as below.

SELECT [EmployeeId], [FirstName], [LastName]
FROM Employees AS DaysDifference
WHERE DATEDIFF(DAY, CAST('04/29/2022' AS DATE), CAST('05/01/2022' AS DATE)) BETWEEN 1 AND 3