title: SQL Server get records before a defined time
body: <p>I am trying to get a list of records that have been in the system only before 05:00:00 pm of the day the query is being run. I have this query that works in the basic testing, but I wanted to see if there is a better option than to do the SQL concatenation.</p>
  
  <pre><code>select *
    from Payment
   where createTimestamp &lt;= CONVERT(VARCHAR(10), Getdate(), 120) +' '+'17:00:00';
  </code></pre>
  
  <p>This query will be used on SQL Server 2008.</p>