I'm doing my final year project using asp.net as front end and SQL Server 2005 as back end
My question is: I want extract only the year from datetime format. And use the year to filter data
I'm doing my final year project using asp.net as front end and SQL Server 2005 as back end
My question is: I want extract only the year from datetime format. And use the year to filter data
In C#:
int year = DateTime.Now.Year;
If you mean at the T-SQL level:
DATEPART ("yyyy", date)