Hi...
I have, at home, a database t hat is a journal. It has multiple purposes - track hours at an internship, as well as to keep a journal of activities.
I'm having some difficulties with one of the functions. I did a search here and found out how to calculate the difference in Time fields
So, in my form for entering hours/dates I added an unbound text box, and put this in the control source:
=DateDiff("h",[fldtimestarted],[fldtimeended])
The fields that it is calculating are Date/Time fields - Formatted in Short time. I work 9-5 and willl NEVER work overnight. I store the time in 24 hour format.
This works great except when I have partial hours. So today I worked from 14:00 to 17:30 But it says that I worked 3 hours, rather than 3.5 hours.
I tried to do this:
=DateDiff("h",[fldtimestarted],[fldtimeended]*24)
And it gave me some very very strange numbers (like -831.99999)
so I tried:
=DateDiff("n",[fldtimestarted],[fldtimeended] / 60)
and once again got some very strange numbers.
Can someone help me out with this? I want to keep the Date and Time fields seperate due to differing requirements at the place I work versus the college - since I'll never work overnight I was hoping that wouldn't be an issue...
Thank you again for all your help =)
I can zip/attach the database if that would help, just let me know.
I have, at home, a database t hat is a journal. It has multiple purposes - track hours at an internship, as well as to keep a journal of activities.
I'm having some difficulties with one of the functions. I did a search here and found out how to calculate the difference in Time fields
So, in my form for entering hours/dates I added an unbound text box, and put this in the control source:
=DateDiff("h",[fldtimestarted],[fldtimeended])
The fields that it is calculating are Date/Time fields - Formatted in Short time. I work 9-5 and willl NEVER work overnight. I store the time in 24 hour format.
This works great except when I have partial hours. So today I worked from 14:00 to 17:30 But it says that I worked 3 hours, rather than 3.5 hours.
I tried to do this:
=DateDiff("h",[fldtimestarted],[fldtimeended]*24)
And it gave me some very very strange numbers (like -831.99999)
so I tried:
=DateDiff("n",[fldtimestarted],[fldtimeended] / 60)
and once again got some very strange numbers.
Can someone help me out with this? I want to keep the Date and Time fields seperate due to differing requirements at the place I work versus the college - since I'll never work overnight I was hoping that wouldn't be an issue...
Thank you again for all your help =)
I can zip/attach the database if that would help, just let me know.