title: DateTime format using t-sql string functions in SQL Server query
body: <p>Using t-sql string functions</p>
  
  <pre><code>substring(convert(varchar, getdate(), 120),6, 11)
  </code></pre>
  
  <p>this will return <code>mm-dd hh:mm</code></p>
  
  <p>But then how do I get datetime format <code>yy-mm-dd hh:mm</code> ?</p>
  
  <p>Thank you so much in advance.</p>