title: How query get value where date Now in SQL Server
body: <pre><code>SELECT TOP 1000 
      TGL = CONVERT(DATE, TIMESTAMP), RIGHT('0' + CAST(DATEPART(hour, TimeStamp) AS VARCHAR(2)), 2) AS jam,
      Nilai = MAX(NILAI)
  FROM 
      PLC_CPress2P1 
  GROUP BY 
      CONVERT(DATE, TIMESTAMP), RIGHT('0' + CAST(DATEPART(hour, TimeStamp) AS VARCHAR(2)), 2)
  ORDER BY 
      CONVERT(DATE, TIMESTAMP), RIGHT('0' + CAST(DATEPART(hour, TimeStamp) AS VARCHAR(2)), 2) DESC
  </code></pre>
  
  <p>I've tried <code>GATEDATE()</code> and <code>NOW</code> - both do not work</p>