title: SQL Server ISDATE() Function - Can someone explain this?
body: <p>So I was looking at the documentation for the ISDATE() function in SQL Server and saw this in the examples:</p>
  
  <pre><code>SET DATEFORMAT mdy;
  SELECT ISDATE('15/04/2008'); --Returns 0.
  SET DATEFORMAT mdy;
  SELECT ISDATE('15/2008/04'); --Returns 0.
  SET DATEFORMAT mdy;
  SELECT ISDATE('2008/15/04'); --Returns 0.
  SET DATEFORMAT mdy;
  SELECT ISDATE('2008/04/15'); --Returns 1.
  </code></pre>
  
  <p>The last example returns 1 (a valid date) but the date format above doesn't match the format in the expression of the function. I thought it was a mistake in the documentation but then curiously tried it out myself and it does actually return 1.</p>
  
  <p>So why is '2008/04/15' a valid date when the date format is mdy?</p>
  
  <p>Documentation here: <a href="http://msdn.microsoft.com/en-us/library/ms187347(SQL.105).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms187347(SQL.105).aspx</a></p>