If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Time Calculation
I am calculating the amount of time that an employee is tardy. I am using
the following expression: TardyTime: Format([ATIME]/1440)-([SHSTART]/1440),”h:nn”). The problem I have is that if an employee punches in early the expression doesn’t return a negative amount of time. How do I get the expression to return a negative amount of time for punches prior to the scheduled start time and a positive amount of time for punches after the scheduled start time? I’ve also tried an IIf statement, TardyTime: Format(IIf(([SHSTART]/1440)([ATIME]/1440),([SHSTART]/1440)-([ATIME]/1440)*-1,([SHSTART]/1440)-([ATIME]/1440)),"h:nn"). Thanks for your help. |
#2
|
|||
|
|||
Time Calculation
See:
Calculating elapsed time at: http://allenbrowne.com/casu-13.html The article explains how (and why) to get the result in minutes, and then display it as hours and minutes. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Scott" wrote in message ... I am calculating the amount of time that an employee is tardy. I am using the following expression: TardyTime: Format([ATIME]/1440)-([SHSTART]/1440),"h:nn"). The problem I have is that if an employee punches in early the expression doesn't return a negative amount of time. How do I get the expression to return a negative amount of time for punches prior to the scheduled start time and a positive amount of time for punches after the scheduled start time? I've also tried an IIf statement, TardyTime: Format(IIf(([SHSTART]/1440)([ATIME]/1440),([SHSTART]/1440)-([ATIME]/1440)*-1,([SHSTART]/1440)-([ATIME]/1440)),"h:nn"). Thanks for your help. |
#3
|
|||
|
|||
Time Calculation
Worked great, thanks!
"Allen Browne" wrote: See: Calculating elapsed time at: http://allenbrowne.com/casu-13.html The article explains how (and why) to get the result in minutes, and then display it as hours and minutes. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Scott" wrote in message ... I am calculating the amount of time that an employee is tardy. I am using the following expression: TardyTime: Format([ATIME]/1440)-([SHSTART]/1440),"h:nn"). The problem I have is that if an employee punches in early the expression doesn't return a negative amount of time. How do I get the expression to return a negative amount of time for punches prior to the scheduled start time and a positive amount of time for punches after the scheduled start time? I've also tried an IIf statement, TardyTime: Format(IIf(([SHSTART]/1440)([ATIME]/1440),([SHSTART]/1440)-([ATIME]/1440)*-1,([SHSTART]/1440)-([ATIME]/1440)),"h:nn"). Thanks for your help. |
Thread Tools | |
Display Modes | |
|
|