2
Answers

upcoming birthday query still issue

Rashid Khan

Rashid Khan

14y
4.6k
1
Noo dear.
i also made this mistake. we cannot check year.
i just want, tht query which can filter  DOB from database and check tht it'll come in next 10 days from the current day, if yes then return name nd DOB frm DB
i think i have to use CAST something like this.

select FirstName,DOB  from PersonalAddBook where CAST(CAST(MONTH(DOB) AS VARCHAR(2)) + '/' +

                CAST(DAY(DOB) AS VARCHAR(2)) + '/' +

                CAST(YEAR(DOB) AS VARCHAR(4))AS DATETIME)between getdate() and  getdate()+10

but it returns nothing, but i think it can be solved by this way,
so can anyone please help me so tht i come out from this issue.
Thanks.
Answers (2)