title: How to convert time to hh:mm:ss tt in SQL Server
body: <p>I want to convert time to format like <code>01:05:33 PM</code> which is saved in database like <code>13:05:33</code>. What should be the query for that. I want to get <code>12 hour format</code> basically. In the database it may be saved in <code>24 hr</code>. It's only <code>time</code> field.</p>
  
  <p>I have used <code>FORMAT</code> function but it gives error that <code>FORMAT()</code> function is not valid.</p>