title: Conversion failed when converting datetime from character string
body: <p>hi 
  i have a problem on converting datetime from character string on createddate and leavestartdate column.....</p>
  
  <p><strong>Table structure   createdby varchar(30),createddate datetime, leavetype varchar(30), leavestartdate varchar(30), status varchar(30)</strong></p>
  
  <pre><code>ALTER Procedure [dbo].[sp_SearchLeave]
  @createdby      varchar(30) = null ,
  @createddate    DateTime    = null ,
  @leavetype      varchar(30) = null ,
  @leavestartdate varchar(30) = null ,
  @status         varchar(30) = null
  
  As
  Begin
  
  if @createddate is not null and Len(@createddate) = 0 set @createddate = null
  if @leavetype = 'Select' set @leavetype = null
  if @leavestartdate is not null and Len(@leavestartdate) = 0 set @leavestartdate = null
  if @status = 'Select' set @status = null
  
  Select leaverequestid,leaveenddate,leavetype,leavestartdate,status
  from LeaveRequest
  where 
         (@createdby is null or createdby like '%' + @createdby + '%')
    and  (@createddate is null or createddate like '%' + @createddate + '%')
    and  (@leavetype is null or leavetype like '%' + @leavetype + '%')
    and  (@leavestartdate is null or leavestartdate like '%' + @leavestartdate + '%')
    and  (@status is null or status like '%' + @status + '%')
  End
  </code></pre>
  
  <p>when i execute this sp as a input like 
  exec sp_SearchLeave '','','','12/15/2010',''</p>
  
  <p>it displays the error message like<br>
  Msg 241, Level 16, State 1, Procedure sp_SearchLeave, Line 26
  Conversion failed when converting datetime from character string.</p>