Here is the code that I using.
AND (@Parm_Year = DATEPART(YYYY, field))
Using this allows me to pick one year at a time only not multiple years.
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
set the parameter to allow multiple results, use AND DATEPART(YYYY,field) IN (@Parm_Year)
21 People are following this question.
Call a stored procedure in c#
IN() clause with parameters
Entity Framework, Optional parameters
Multi-step OLE DB generated errors
How to create a scalar function with parameter in the select statement?