Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Get name in month in sql

Author  Topic 

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2008-05-06 : 01:44:52
hi
i have one table their is two colomn one is name and second birhtdate
how to find name is born month name May

thank

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-06 : 01:55:03
DATENAME(mm,birthdate)
Go to Top of Page

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2008-05-06 : 02:05:46
hi Visakh16

i have write query to

Select * from tablename
where birthdate in(DATENAME('MM','2006-5-23'))

dispaly error

Invalid parameter 1 specified for datename.


Go to Top of Page

soorajtnpki
Posting Yak Master

231 Posts

Posted - 2008-05-06 : 02:57:41
hi
try this
Select * from table where DATENAME(month,dob)='may'

ok
Go to Top of Page

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2008-05-06 : 03:02:14
thanks soorajtnpki
it is work
Go to Top of Page
   

- Advertisement -