Time Calculation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Worked great, thanks!

Allen Browne said:
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

Reply to group, rather than allenbrowne at mvps dot org.

Scott said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top