title: How does SQL Server compare a date to a string literal?
body: <p>I am modifying a query, here is my script:</p>
  
  <pre><code>select 
  CASE When EndDate='1/1/1900' 
  THEN NULL 
  ELSE EndDate END,*
  from Members
  </code></pre>
  
  <p>This script simply compares date, if it is '1/1/1900' then returns <code>null</code> otherwise it returns the date.</p>
  
  <p>I can see in my database date is stored in the following format:</p>
  
  <pre><code>1900-01-01 00:00:00.000
  </code></pre>
  
  <p><strong>Question</strong> is how SQL Server is matching date like this when my pattern is different from the stored one. Also in date format I am not passing time element.</p>