title: Conversion failed when converting date and/or time from character string - Msg 241, Level 16, State 1,
body: <p>I keep getting the following error to my code when I either try to set it as <code>cast()</code> or <code>convert()</code>.  Nothing seems to work.</p>
  
  <p>Query:</p>
  
  <pre><code>SELECT TOP 100
      *
  FROM [OptionsDW].[dbo].[Octagon5]
  WHERE CONVERT(datetime2, CurrDate, 121) 
            BETWEEN CAST('2010-01-01' AS date) AND CAST('2010-06-31' AS date)
  </code></pre>
  
  <p>Result:</p>
  
  <blockquote>
    <p>Msg 241, Level 16, State 1, Line 2 Conversion failed when converting
    date and/or time from character string.</p>
  </blockquote>
  
  <p>I know there are many similar queries but none of them helped with my problem.</p>