How do I calculate the number of hours worked from the clock out time and and the Clock in time. I thought it would be straight forward using the math column but I don’t like the answer I get.
For example for a time period between 07:00 AM and 12:30 AM I get a result of 6:30 which I assume is hours but I am not sure. Any suggestions how I go about this?
Subtracting one date/time from another will give you a duration in hh:mm:ss.
You just need to ensure both your start and end columns are correctly configured as date/time types, and keep in mind that the underlying value will always include a date - even if you have it configured to display time only.
Thanks for your speedy response. I would have expected the same thing you are saying above but i seem to get difference result unless i am missing something
This is how the math column is configured as below
EDIT:
i think i know what the problem is, I just saw that my clock out time is actually before my clock in time (Lol) due to the AM…It should have been PM…
My apologies for this silly moment. I should step away from my device now…
“For example, a worker will be paid Rp50,000 per hour (in Indonesian currency). If the worker works 8 hours, they will receive Rp400,000. My question is, how do I multiply a time format with a numeric format?”
Sounds like you’re having a duration. Use TRUNC alongside how you’re calculating durations to convert them to a numeric format, before multiplying with the hourly salary.