I have need to calculate the time duration over several days, the result being hours and minutes. For instance: Employee "A"
starts work on 4/25/05 at 4:00 pm and ends his shift on 4/27/05 at 1:00 am. How do I calculate this?
This is a multi-step process and it is more complicated than you might think. Since you did not say which SmartSuite program you are using, I will just give you the "theory" here:
1) Determine the number of hours and minutes on the start day by subtracting the start time from midnight (24:00)
2) The number of hours and minutes on the end day is simply the time the employee stops working.
3) Determine whether more than one day has passed between the two date-time entries and add 24 hours for each day. You cannot simply use the day number because the employee may have worked across the end of a month or year. See if your product has a "DayOfYear" function and use it along with the year values in the two dates to determine the number of days elapsed and subtract 1. Then multiply the number of days by 24 to get hours.
4) Add the values from #1, #2 and #3 to get total elapsed hours and minutes.
Thank You, Sue! I'll try it Saturday while at the office. The application will be in Approach from SS 9.8, although using a table in WordPro might be an alternative.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.