Forum Discussion
Differense between 2 dates and time
Ive got a table with columns like this.
1 column, persons (ID)
1 column with date and time (shiftstart)
1 column with date and time (shiftto)
And i want to see how many rows that have less then 11 hours between shiftstart and shiftto per person.
Person 1:
Shiftstart: 2023-01-03 16:00:00
Shiftto: 2023-01-03 22:00:00
Shiftstart: 2023-01-04 07:00:00
Shiftto: 2023-01-04 16:00:00
That would result in 1 row. Less then 11 hours between when the first shift ended to the second shift started.
I dont have a clue how to make this work 😕
4 Replies
- IdrissshatilaSuper User
Hello Kristiankommune ,
check if you could use this video for your case https://youtu.be/6JA6uy3ZRBA
If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudos 👍
- KristiankommuneFrequent Visitor
I dont know if that helped me.
This is my table below.
This is the same person (perid).
And the two dates has less then 11 hours between the end of 21/2 and the start of 22/2.
- IdrissshatilaSuper User
try this
Hours = Datediff ( ShiftFrom, ShiftTo, Hour )
Just put the field shift from and shift to in the measure.
If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudos 👍
- KristiankommuneFrequent Visitor
I tried it but it only counts the hours between shiftstart and shiftto on one line.
I want to know the hours between date 1 and date 2.
If there is less then 11 hours between ShiftTo date 1 and ShiftStart date 2.