PDA

View Full Version : Calculating A Time



mattster1010
08-07-2008, 04:28 AM
Hi All,

I am creating a timesheet application and have users inputting thier times in and out etc...

I have a total field that caculates the total time worked, this textbox has a format of short time. It seems though that when a total increases past 24, the total goes back to zero. I now understand why this is happening due to a 24 hour format, is there anyway I can bypass this and continue adding up the total past 24?

Cheers,

Matt

CreganTur
08-07-2008, 05:22 AM
Have you considered formatting their times as decimal time? Then you can just store the times as one of the number data types. This will keep you from running into the 24 hour formatting restriction for the Time data type.

This is how the company I work for handles timesheets.

HTH:thumb

mattster1010
08-07-2008, 05:31 AM
Hey CreganTur, hope all is good.

I'm sure I tried that, I used the decimal data type which did bypass the 24 hour restriction but then I found that my totals where calculated on 100 rather than by 60. Is there any way that I can calculate on 60 instead of 100?

Cheers,

Mattster

CreganTur
08-07-2008, 06:52 AM
There's a rather involved mathematical formula that will tanslate decimal time into standard (60 minute) time. You can find it via google. It's the only way I know to do this... There may be a much better/easier way to deal with this that I'm unaware of.

Carl A
08-09-2008, 05:48 PM
See if this is what you want?

http://support.microsoft.com/kb/210604

HTH