Click to See Complete Forum and Search --> : datetime in sqlserver


rajesh_css
10-08-2008, 10:03 PM
Hi,

I have a table which has a column of type datetime,i want to write a query where i can get only year from my datetime datatype column.


2004-11-16 00:00:00.000 this is the one which i have i required only 2004 on selecting.

Thanks in Advance
Raj

rajesh_css
10-08-2008, 10:14 PM
datepart(yyyy,getDate())
this worked out.........