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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 yyyy out of mm/dd/yyyy

Author  Topic 

db_sysadmin
Starting Member

27 Posts

Posted - 2005-12-29 : 08:24:25
Hey guys,

Can't figure out which function is it, to get only the year of a date in this format mm/dd/yyyy.

Thanks in advance

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-29 : 08:31:51
Is this?
select year(getdate()) as YearOnly


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

db_sysadmin
Starting Member

27 Posts

Posted - 2005-12-29 : 08:44:34
Yes man, it worked fine.

thanks!
Go to Top of Page

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2005-12-29 : 22:53:23
Or
select datepart(yy,getdate())
Go to Top of Page
   

- Advertisement -