title: SQL Msg 8114, Level 16, State 5, Procedure sp_product_listing, Line 0 Error converting data type varchar to datetime
body: <p>/<em>I'm new in SQL and I'm asked to create a procedure somehow procedure successfully created but when I try running the execute it didn't work.
      Can someone give me a hand please?</em>/</p>
  
  <pre><code>CREATE PROCEDURE sp_product_listing
  (
  @product varchar(40) ='%',
  @month datetime,
  @year datetime 
  )
  AS
  SELECT
  products.name AS product_name,
  products.unit_price,
  products.quantity_per_unit,
  suppliers.name AS supplier_name
  FROM products
  INNER JOIN suppliers ON products.supplier_id=suppliers.supplier_id
  INNER JOIN order_details ON products.product_id=order_details.product_id
  INNER JOIN orders ON order_details.order_id=orders.order_id
  WHERE products.name LIKE @product 
  AND
  @month=CONVERT(char(10),MONTH(orders.order_date))
  AND
  @year=CONVERT(char(10),YEAR(orders.order_date))
  </code></pre>
  
  <p>the run with an error
      when I run the execute 
      EXECUTE sp_product_listing
      'Jack',
      'June',
      '2001'</p>
  
  <p>This is the error message I get</p>
  
  <blockquote>
    <p>Msg 8114, Level 16, State 5, Procedure sp_product_listing, Line 0
        Error converting data type varchar to datetime.</p>
  </blockquote>
  
  <p>month and year are the one I'm stuck at.  </p>