A CALCULATION

danaleblanc

Registered User.
Local time
Today, 22:58
Joined
Jun 13, 2001
Messages
41
I have a Beginning Time field and a Sick Leave Time field and am trying to calculate an Accumulated Time field (Beginning Time – Sick Leave Time).
For example –
Beginning Time 40:00
Sick Leave Time 3:00
Accumulated Time 37:00
Tried everything I could think of but is not working. Any help would be appreciated
 
Use a query or DAO recordset to build the field you want.
 
Look in the help files for topic DateDiff, read up on that, and follow some of the "see also" links.

That should give you some ideas. However, there is another way to look at this.

Computing time like that will confuse Access tremendously. Access doesn't think of time in the way you are using it and will do its very best to turn 37:00:00 into 2-Jan-{something or another} 1:00:00 PM. You might do better to track this as a number of hours as a Single (floating-point) variable. It might be less intuitive but I'm sure Access will lead you down a garden path the other way.
 
If all 3 fields are quantitive time values, then I would suggest that you format those fields as numbers and not date/time formats. Then it would be simply a matter of setting the control source of your [Accumulated Time] textbox, on your form (or report), to:

=[Begining Time]-[Sick Leave Time]

I would suggest that you do not have [Accumulated Time] as a field in any table since you can generate that value from the other two fields ...

Hope I am on track here...

Mitch
 

Users who are viewing this thread

Back
Top Bottom