title: Conversion error when converting datetime from string
body: <p>I am trying to create a stored procedure. The date columns use <code>varchar</code> data type. </p>
  
  <p>I want to be able to select data using the dates as the constraints. </p>
  
  <pre><code>ALTER PROCEDURE [dbo].[spStatusReport]
       @ShipFrom VARCHAR(20) = NULL,
       @ShipTo VARCHAR(20) = NULL,
  AS
      SELECT 
          LOCATION, NEXT_DEPT,
          CAST(CONVERT(VARCHAR, REQ_DATE, 104) AS DATETIME) AS REQ_DATE,
          CAST(CONVERT(VARCHAR, SCH, 104) AS DATETIME) AS SCH,
          Tool
      FROM 
          Status_Report 
      WHERE 
          (@ShipFrom IS NULL OR 
           CAST(CONVERT(VARCHAR, SCH, 104) AS DATETIME) &gt;= CAST(CONVERT(VARCHAR, @ShipFrom, 104) AS DATETIME))
          AND (@ShipTo IS NULL OR 
               CAST(CONVERT(VARCHAR, SCH, 104) AS DATETIME) &lt;= CAST(CONVERT(VARCHAR, @ShipTo, 104) AS DATETIME))
  </code></pre>
  
  <p>When I try to execute this stored procedure </p>
  
  <pre><code>exec spStatusReport '12/04/2018','NULL'
  </code></pre>
  
  <p>I want the user to be able to only pass one parameter either ShipFrom or ShipTO or even both but I get this error </p>
  
  <blockquote>
    <p>Conversion failed when converting date and/or time from character string</p>
  </blockquote>