I want to search Date of Birth from my sql server database table. Problem what i am getting is the year of DOB will be different and will be latter than current year. If i want to get customer list whose birthday will coming in next 7 days same as facebook birthday reminder.
I have tried to convert smalldatetime
to varchar
and used LIKE
statement with '_' wild card character. for example Convert(Char(10),DOB,103) LIKE "__/02/____'
. but, it gives me list of customers whose DOB is coming in current month. Also it shows me those data whose birthday has gone previously on current month. I want to only those data whose birthday is coming on next 7 days.
My application has developed in C#. if possible to get appropriate result using DataTable
or DataView
then please suggest me.