get user name not show..

Posted by Naveenmanam under ASP.NET on 4/28/2010 | Views : 1205 | Status : [Member] | Replies : 3
Continue From Thread - 1

Select useremail from birthmail where dob =(select convert(varchar(20),getdate(),1) as expr1)

this query will not work ie: if the birthDate in DB is like this

birthdate = 4/28/1984 12:00:00 AM

so currentDate is = 4/28/2010 12:00:00 AM

if you run the query it will not show that record.. ?

NaveenKumar


Responses

Posted by: Pavanandey on: 4/28/2010 [Member] Bronze

Up
0
Down
in sql since the dataformat is stored in different format we need to convert on both sides to a equal format

convert(char(8),datetimecol, 112) = convert(char(8),@paramater, 112)


Hope this helps you

Thanks
Pavan Kumar
Mark Answer if this fits the need

Naveenmanam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naveenmanam on: 4/28/2010 [Member] Starter

Up
0
Down
thank you pavan kumar
but i want years are separate always remind the month and date..

NaveenKumar

Naveenmanam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pavanandey on: 4/28/2010 [Member] Bronze

Up
0
Down
Hi Naveen,

i could understand ur query plz let me know wht exactly wht

Thanks
Pavan Kumar
Mark Answer if this fits the need

Naveenmanam, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response