title: Stored Procedure Help: Passing a Year as a parameter to get results
body: <p>I'm trying to basically input a year (not the entire date) to get back a set of results that will tell me the amount of things sold this year. I'm not sure how to go about doing this however. Below is an example of what I have down.</p>
  
  <pre><code>ALTER PROC OrderYear
  (@OrderYear datetime)
  AS
  
  SELECT Orderdate as [Year],COUNT(SalesOrderID) as Count
  FROM Sales.SalesOrderHeader
  WHERE @OrderYear=YEAR(OrderDate)
  GROUP BY OrderDate
  
  BEGIN
  SET NOCOUNT ON
  END
  
  EXEC OrderYear '2005'
  </code></pre>