title: Microsoft SQL Server - Pulling timecard data by employee in database
body: <p>I have a database where we used old punch in and out data that was saved in our SQL Server and want to know how to pull the timecard data by <code>CEMPID</code> as shown below. I am looking to measure the <code>TIN</code> (Time in) and <code>TOUT</code> (Time Out) metrics preferably for year to date 2021, I want to be able to separate the rows by day if possible. So basically just filtering through the data to get all data pertaining to 2021 time in and out only</p>
  <p><a href="https://i.stack.imgur.com/Tvnyu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tvnyu.png" alt="enter image description here" /></a></p>
  <p>Any help with this is appreciated, the ways I have tried setting up the query using WHERE functions is not doing it for me.</p>