title: sql - beginning of hour, month etc
body: <p>I know how to get in SQL (SQL Server) the current date, but with the beginning of the day:</p>
  
  <pre><code>select dateadd(DAY, datediff(day, 0, getdate()),0) 
  (result:2009-09-17 00:00:00.000)
  </code></pre>
  
  <p><strong>I need</strong> to get (in SQL) the current date with the beginning of this hour.
  For example: 2009-09-17 17:00:00 (I don't care about the exact format)</p>
  
  <p>and <strong>I need</strong> to get the current date but with the beginning of this month:
  For example: 2009-09-01 00:00:00.000 (I don't care about the exact format)</p>
  
  <p>Can you help me? Thanks in advance</p>