G
Guest
I need to calculate the time (in hours) it takes to complete a job function.
I currently have INPUTTime and ENDTime fields in my table that are set-up as
Date/Time - Medium Date.
In my form the INPUTTime field is a hidden field that is not visible and is
defaulted to =Now() so that when opening the form the user does not have to
enter the date/time.
On the same form I have the ENDTime field that the used input the time that
they completed the task in the format 99:00\ >LL;0;_.
I have tried (in a query or unbound text box) using the following
DateDiff("h",[INPUTTime],[ENDTime) calculation to come up with the time it
took to complete the task but come up with wierd results.
I have tried:
"n" for minutes
"d" for days
dividing this by many multiples of days*hours*minutes*seconds, etc.
I do understand that the date/time results are a binary? value that looks
nothong like a date or time, but can be formated in the forms field to the
format you need.
Another issue is that it seems as though the results are increasing with
each record by some variable when I calculate using the DateDiff function.
This is what I see in my current query with Expr2:
DateDiff("h",[ENDTime],[INPUTTime]):
INPUTTime ENDTime Expr2
07/05/07 9:37:24 AM 10:48 AM 942431
07/05/07 10:12:41 AM 11:12 AM 942431
07/05/07 2:02:38 PM 2:23 PM 942432
07/05/07 2:28:15 PM 8:28 AM 942438
1. I would like the expr2 results to show the elapsed hours it took to
complete the job in the form.
2. Is there also an automated way to have the ENDtime field be entered as
the forms CLOSEDate is entered. What I have is a CLOSEDDate filed
"Date/Time" and was wondering how when entering the close date to signify the
record is closed that I could calculate this time from this field?
Thank - Tim
I currently have INPUTTime and ENDTime fields in my table that are set-up as
Date/Time - Medium Date.
In my form the INPUTTime field is a hidden field that is not visible and is
defaulted to =Now() so that when opening the form the user does not have to
enter the date/time.
On the same form I have the ENDTime field that the used input the time that
they completed the task in the format 99:00\ >LL;0;_.
I have tried (in a query or unbound text box) using the following
DateDiff("h",[INPUTTime],[ENDTime) calculation to come up with the time it
took to complete the task but come up with wierd results.
I have tried:
"n" for minutes
"d" for days
dividing this by many multiples of days*hours*minutes*seconds, etc.
I do understand that the date/time results are a binary? value that looks
nothong like a date or time, but can be formated in the forms field to the
format you need.
Another issue is that it seems as though the results are increasing with
each record by some variable when I calculate using the DateDiff function.
This is what I see in my current query with Expr2:
DateDiff("h",[ENDTime],[INPUTTime]):
INPUTTime ENDTime Expr2
07/05/07 9:37:24 AM 10:48 AM 942431
07/05/07 10:12:41 AM 11:12 AM 942431
07/05/07 2:02:38 PM 2:23 PM 942432
07/05/07 2:28:15 PM 8:28 AM 942438
1. I would like the expr2 results to show the elapsed hours it took to
complete the job in the form.
2. Is there also an automated way to have the ENDtime field be entered as
the forms CLOSEDate is entered. What I have is a CLOSEDDate filed
"Date/Time" and was wondering how when entering the close date to signify the
record is closed that I could calculate this time from this field?
Thank - Tim