kholm
01-09-2002, 07:27 AM
Our time clock program imports time as hours:seconds, short time. Our data entry program imports time as numeric seconds. I need to compare the two and come up with percentages, such as percentage of time a person spends doing data entry compared to the time they are acutally clocked in. But how do I change the data entry time from seconds to hours and from numeric to short time. I did the obvious, such as changing properties to short time and dividing the seconds by 3600, but I get weird answers.
David R
01-09-2002, 09:27 AM
I think you might be doing this backwards. Since you're going to be using mathematical calculations on their time, you want both fields to be numeric. Get the time difference between the start and end times from your time clock, change that to numeric seconds, and calculate away. You can always format the answers later if you need to.
kholm
01-09-2002, 12:37 PM
I see how that can be done, but when I try to change the hours format from short time to general number, it gives me some freaky number back.
David R
01-09-2002, 01:26 PM
Take a look at this article to work with elapsed time functions. Keep in mind that if you're seeing a 'weird' result, such as 1.3145672356, you're probably looking at the serial result of a calculation.
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q88657
There is even a GetTimeCardTotal() sample function.
Good luck,
David R
kholm
01-14-2002, 06:58 AM
I think part of the problem is the hours:minutes is being imported as short time, which it actually is not. The original file has a colon inbetween the hours and minutes therefore it sees it as short time. How do I change that?
Pat Hartman
01-14-2002, 04:56 PM
Create an import spec so that you can import the hh:mm field as a text string. If your input file is fixed length, you'll be able to easily separate the hours and minutes into separate numeric fields. If it is a delimited format, you're stuck with a text string. Once you have the elapsed time as a text string, you can convert it to seconds with the following formula:
(Left(YourField,2) * 3600) + (Right(YourField,2) * 60)