title: How to get a date in YYYY-MM-DD format from a TSQL datetime field?
body: <p>How do I retrieve a date from SQL Server in <code>YYYY-MM-DD</code> format? I need this to work with SQL Server 2000 and up. Is there a simple way to perform this in SQL Server or would it be easier to convert it programmatically after I retrieve the result set?</p>
  
  <p>I've read the <a href="http://technet.microsoft.com/en-us/library/ms187928.aspx" rel="noreferrer">CAST and CONVERT</a> on Microsoft Technet, but the format I want isn't listed and changing the date format isn't an option. </p>