title: SQL datetime out of range error
body: <p>I am calling a stored procedure from another stored procedure. I need to pass parameter <code>@StartDate</code> and <code>@enddate</code>:</p>
  
  <pre><code>Create procedure GetALL
      (@Startdate datetime,
       @EndDate datetime)
  as
      insert into #test 
         Exec [getCustomerAll] @Startdate, @EndDate
  </code></pre>
  
  <p>I am getting an error </p>
  
  <blockquote>
    <p>The conversion of a varchar data type to a datetime data type resulted in an out-of-range value</p>
  </blockquote>
  
  <p>I cannot modify the <code>getCustomerAll</code> stored procedure as it is written by a third party client</p>
  
  <p>The parameters for <code>GetCustomerAll</code>, <code>@Startdate</code> and <code>@EndDate</code> are all of type <code>datetime</code>.</p>
  
  <p>I am calling <code>GetALL</code> stored procedure from C# asp.net.</p>
  
  <pre><code>exec  GetALL  '15 MAY 2016','15 MAY 2016' . 
  </code></pre>
  
  <p>The issue occuring on calling GetCustomer all </p>
  
  <pre><code>Create PROCEDURE [dbo].[getCustomerAll]
      -- Add the parameters for the stored procedure here
      @DateFrom Datetime,
      @DateTo Datetime,
  
  AS
  BEGIN
  
  
      SELECT  * from Customers
  
      WHERE creation_date BETWEEN CONVERT(VARCHAR(10), @DateFrom, 103) AND CONVERT(VARCHAR(10), @DateTo, 103)
  </code></pre>
  
  <p>Any help appreciated</p>