Dear All,
Can anyone support me i have one colunm which datetime and another column like emp id and i need to calculate there emp total hours and mints date wise from below.

Dear All,
Can anyone support me i have one colunm which datetime and another column like emp id and i need to calculate there emp total hours and mints date wise from below.

Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Prasad RaveendranPosted Jun 30, 2024, 7:16 PM
take a look at the below code and see whether this would works for you
Using a CTE can sometimes improve readability and performance, although the performance gains are more situation-dependent.
Naveen KumarPosted Jun 30, 2024, 2:59 PM
Hello Feroz,
To calculate hours and minutes, we need two datetime values. However, I see only
CHECKTIMEin your provided data. AssumingBADGENUMBERis not a primary key and that the sameBADGENUMBERcan have multipleCHECKTIMEentries, please see the query below to suit your requirement.