title: How to create time slots of the day in SQL server
body: <p>I apologize in advance if you think the question has already been answered, I searched on Stack, but similar answers were much too complex for me.</p>
  <p>I have this request in SQL :</p>
  <pre><code>SELECT dbo.tbTransaction.dateHeure, dbo.tbPoste.nomPoste
  FROM dbo.tbTransaction 
  INNER JOIN dbo.tbPoste ON dbo.tbTransaction.ID_poste = dbo.tbPoste.ID_POSTE
  WHERE dbo.tbPoste.id_site LIKE 17 
  AND dbo.tbPoste.nomPoste LIKE 'POSTE1'
  AND dateHeure &gt;= DATEADD(dd, DATEDIFF(dd,0,GETDATE()), 0)
  ORDER BY dateHeure DESC
  </code></pre>
  <p><a href="https://i.stack.imgur.com/duesE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/duesE.jpg" alt="result" /></a>
  It gives me all the production of the day, the problem is : it's not precise enough because there is a team shift in the afternoon and another team shift in the night.
  If you see all the production of the day, you cannot see which team produced what.
  I would like to create 3 different queries that allow me to see only the production between certain hours (for example, production between 6am and noon). Do you have any advice on how to do this?</p>