Skip to content
Advertisement

DateTime query on only year in SQL Server

I want to select multiple records on the basis of a matching year, for example in table tab where columns are [id] int, [name] varchar, [bookyear] datetime

I want to select all records where the year is 2009.

The following query gives 0 results:

Advertisement

Answer

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement