Warning

 

Close

Confirm Action

Are you sure you wish to do this?

Confirm Cancel
Member Login
Site Notices
10/20/2017 1:01:18 AM
9/22/2017 12:11:25 AM
Posted: 8/1/2005 3:38:03 PM EDT
Link Posted: 8/1/2005 3:44:13 PM EDT
[Last Edit: 8/1/2005 3:49:58 PM EDT by Cableman]
I know there is a datediff function, you may be able to use it for time also.

I would look into that before using 2 different integers for your time keeping function.


A quick search of the Access help system shows this.

Calculating with dates and times You can add and subtract dates and times and include them in other calculations. To use a date or time in a formula, enter the date or time as text and enclose the text in quotation marks. For example, the following formula would display a difference of 68:

="5/12/2004"-"3/5/2004"

Link Posted: 8/1/2005 4:18:46 PM EDT
Link Posted: 8/1/2005 4:24:31 PM EDT
I think if you use Excel you can set the numbers to be valued as hours/minutes.
Link Posted: 8/1/2005 4:29:24 PM EDT
Link Posted: 8/1/2005 5:10:49 PM EDT
To get only the remainder back, you're looking for the MOD function.

dblResults = dblValueA MOD dblValueB

ex:

dblResults = 3 MOD 2

dblResults = .5

Haven't used VBScript for a while but I believe the above should work.
Link Posted: 8/1/2005 5:18:21 PM EDT
[Last Edit: 8/1/2005 5:22:40 PM EDT by Red_Beard]
mod works


use this

=[minutes]/60

for hours

and =([minutes] mod 60)

for minutes
Link Posted: 8/1/2005 5:21:31 PM EDT
[Last Edit: 8/1/2005 5:31:38 PM EDT by Cableman]
Search the MS site...they may have a solution.


www.mvps.org/access/datetime/

You can use the following logic to calculate the difference between two times which works even across midnight.

Format([StartTime] -1 -[EndTime], "Short Time")



A little more info.

If you want to include midnight in your calculation then an easy way is to include a midnight operator (1).

Thus #23.45# -1 = 00:15:00

f you need to go over midnight then you need to include the operator (and format the result to understand it)

#23:45# - 1-#00.15# = -2.08333333333333E-02

but

format(#23:45#-1-#00:15#,"short time") = 00:30

and

format(-2.08333333333333E-02, "short time")= 00:30"



Seems you need to use the format "short time" function to change your integer to a date/time format


So your function is format("return time" - 1 -"start time", "short time")
Link Posted: 8/1/2005 5:25:29 PM EDT
[Last Edit: 8/1/2005 5:26:33 PM EDT by Red_Beard]
edit: fuckit too tired to get it right
Link Posted: 8/1/2005 5:37:35 PM EDT
Top Top