Select ALL records where the time in DateTimeField = 9AM

  • I have a table with that stores hourly data. The customer wants a monthly report, but only wants the records for 9AM to be displayed on the report. So I need to figure out how to select DateTimeField, Volume FROM tblHourlyHistory WHERE DateTimeField = 9AM.

    Any ideas?

  • Something along these lines:

    SELECT SalesOrderID

    FROM Sales.SalesOrderHeader

    WHERE DATEPART(hh,OrderDate) BETWEEN 9 AND 12;

  • Thanks!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply