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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble computing hours in Access 2000 1

Status
Not open for further replies.

burgerman

Technical User
Sep 21, 2002
31
US
Here's my delima. I have a form in a access database that has two combo boxes. Each box starts at 9:00 PM and works itself up to 11:59 PM. After the second box has been selected then the data in both are saved into two seperate text boxes and the difference in hours is saved into a third box. The trouble comes when I try to sum all of the records using the value in the third box in a report it seems that Access has trouble computing the value when the sum of the total exceeds 24 hours. How can I get the report to show the sum of the hours?

I also cannot get access to multiply a pay rate field by the difference field and have it return the proper amount in either a query or a report

Any ideas would be greatly appreciated
 
Hi

See thread 68-359169

regards Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Hi
Title is Help Access working with time
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
thread 68-359169

doesn't exist?

And the Title is not Found

thread181-359169


? perhaps


MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Hi

OK here is the content copied:

Hi

No need to send anything, I get the idea, what I am saying is amend your table to hold the logged in time as a number of minutes (or seconds if you need that level of accuracy), You can then sum them quite nicely because they are just a number, but to print or display them you use the divide and mod operators from my earlier post to convert to days, hours, whatever.

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Hi

Yes, michael, Thread181-359169, is the one, where did I get that otehr number from I wonder?

Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Although the following doesn't directly answer the post, it may give some insight to the basic process of accumulating 'time'.

Public Function basAddTime(ParamArray MyTimes() As Variant) As String

'Michael Red 9/22/02, Tek-Tips thread181-359169 and thread181-364930
'? basAddTime(#07:31:45#, #07:35:21#, #07:33:10#, #07:33:10#, #07:33:10#)
'37.776

Dim tmpTime As Double
Dim Idx As Integer
Dim tmpRtn As Double

For Idx = 0 To UBound(MyTimes)
tmpTime = tmpTime + CDbl(MyTimes(Idx))
Next Idx

tmpRtn = Int(tmpTime) * 24
basAddTime = tmpRtn + ((Round(tmpTime, 3) - Int(tmpTime)) * 24)

End Function


MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
What formula do you use to calculate the difference in hours?

ThisExpression =Int(DateDiff("n",[timein],[timeout])/60)+(DateDiff("n",[timein],[timeout])/60)-Int(DateDiff("n",[timein],[timeout])/60)

displays the decimal representation of the difference in hours between [timein] and [timeout].

You can use it as a multiplier now (I think)...



[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top