title: How to compare time in sql server 2005
body: <p>I have two  columns in table as in a string format <code>starttime</code> and <code>endtime</code> in <code>(HH:MM tt)</code> format like
  <code>Starttime = 12:15PM</code> and <code>endtime = 12:52PM</code>
  I want's to add condition in where clause for sql query to check if startime is greater than endtime</p>
  
  <p>Like below.</p>
  
  <pre><code>Select * from table where StartTime &gt; EndTime
  </code></pre>
  
  <p>(I am not able to compare this condition here)</p>
  
  <p>Can any one help me to add write where for comparing time.</p>
  
  <p>Note: Both the values are stored in string format.</p>