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.
Loading
Rashid KhanPosted May 1, 2010, 2:14 AM
i think u didn't get my point.
my query is checking all this things. but when the days remain less than 10 then is never goes and check from the upcoming month days.
i mean. for example my dob is 30 April. so it starts give me msg from 20th April. (because it comes in next 10 day defined period) but at 21st April that 10 days period cover 1st May also, but it not calculate cause of month didn't change. as i told i want data like we see in orkut nd other social websites. how they filter the dob nd fetch it form database
i hope this may clear my requirement i gone though all my efforts but stuck in month case.
please if anyone knows abt it bd understand my problem please please tell me the solution
Thanks
Altaf PatelPosted Apr 29, 2010, 10:46 PM
Month([DOB]) = Month(Now())
selectingmonths from DOB column and checking if it = current month....
mark answer if you like it...
so that it become easy for other to know that issue is resolved or not...
ALtaf ...........