Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time Tracking Problem 1

Status
Not open for further replies.

cghoga

Programmer
Jun 26, 2003
614
US
I need help!

I am building a time tracking app.

How do you get the difference between 2 dates/times into a variable or field value?

Like for example, there is a clockin and a clockout time.
How do I determine the time span value between the 2?

Thanks for any and all help.
 
If you're using dBaseIII+, you'll have to build your own function or procedure to calculate the duration between times. It's been a long time since I had to do that but basically, you have to break down your start and end times into the lowest form - usually seconds, do the math, than convert the total elapsed seconds into hours, minutes, and seconds.

It can be a bit frustrating but go at it bit by bit and you'll get there.

There's always a better way. The fun is trying to find it!
 
Thanks tviman.

I figured it out. I used the Elapsed() function.
It gives the elapsed time between 2 values in secs, then I had to divide by 3600 to get an hourly value.

Thanks again for the post.
 
I wasn't aware that elapsed() was a dBaseIII+ function. I know that dbXl came out with it in there upgraded clone of BaseIII+. Anyway, glad you got it worked out.

There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top