Rashid Khan

Rashid Khan

  • NA
  • 159
  • 0

upcoming birthday query still issue

Apr 29 2010 6:33 AM
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)