Hi Frndz,
Functionality: Get BOD current date to 15 days
To achieve this task,
First you need to make date
birthdate +'/'+ CAST( YEAR(GETDATE() ) AS VARCHAR)
After then CAST it to DateTime
CAST( birthdate +'/'+ CAST( YEAR(GETDATE() ) AS VARCHAR) as DATETIME)
After Added 14 to Current Date
DATEADD(Day,14,getdate())
Now get Data between two Date, Current Date and After 14 Days add Date
CONVERT(varchar(10),getdate(),102) and CONVERT(Varchar(10), DATEADD(Day,14,getdate()),102)
Check Below logic for more detail
Full Logic :
select empname,birthdate from tblBirthDetail
WHERE
CONVERT(Varchar(10), CAST( birthdate +'/'+ CAST( YEAR(GETDATE() ) AS VARCHAR) as DATETIME),102)
BETWEEN CONVERT(varchar(10),getdate(),102) and CONVERT(Varchar(10), DATEADD(Day,14,getdate()),102)
Hope this helpful!
Thanks