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
, [boo
One of the most important things to remember with regards to SQL Server and dates is that the best format to use is this: 'YYYYMMDD'
(or 'YYYYMMDD HH:MI:SS'
). This format will always be interpreted properly by SQL Server, regardless of regional date settings.
SELECT [ACCNO]
,[Roll No]
,[IssueDate]
,[DueDate]
FROM [test1].[dbo].[IssueHis$]
WHERE [IssueDate] >= '20090101'
AND [IssueDate] < '20100101'