calculate of hour in a function

  • Thread starter Thread starter Frank Dulk
  • Start date Start date
F

Frank Dulk

As I do that I calculate of hour in a function to use in a query

(Hour1-Hour2)+(Hour3-Hour4)+(Hour5-Hour6)

That in hour and minutes

that for doing a bank of hours
 
As I do that I calculate of hour in a function to use in a query

(Hour1-Hour2)+(Hour3-Hour4)+(Hour5-Hour6)

That in hour and minutes

that for doing a bank of hours

If Hour1 and so on are Date/Time fields, use

DateDiff("h", [Hour1], [Hour2])

to calculate the time difference in hours.

John W. Vinson[MVP]
 
this in the format hour only hour.

and I have to do that I calculate and to obtain the total in hour and
minutes


John Vinson said:
As I do that I calculate of hour in a function to use in a query

(Hour1-Hour2)+(Hour3-Hour4)+(Hour5-Hour6)

That in hour and minutes

that for doing a bank of hours

If Hour1 and so on are Date/Time fields, use

DateDiff("h", [Hour1], [Hour2])

to calculate the time difference in hours.

John W. Vinson[MVP]
 
this in the format hour only hour.

What is the datatype of the field [Hour1]?

The format of the field does not matter. What is the Datatype?
Date/Time, Integer, Text?
and I have to do that I calculate and to obtain the total in hour and
minutes


John W. Vinson[MVP]
 
the field is of the type date/time

John Vinson said:
As I do that I calculate of hour in a function to use in a query

(Hour1-Hour2)+(Hour3-Hour4)+(Hour5-Hour6)

That in hour and minutes

that for doing a bank of hours

If Hour1 and so on are Date/Time fields, use

DateDiff("h", [Hour1], [Hour2])

to calculate the time difference in hours.

John W. Vinson[MVP]
 
Calculate it in minutes using

DateDiff("n", [Hour1], [Hour2]) + DateDiff("n", [Hour3], [Hour4]) +
DateDiff("n", [Hour5], [Hour6])

and use an expression like

[TextMinutes] \ 60 & ":" & Format([TextMinutes] MOD 60, "00")

on a form to format the result as hours and minutes.

Sorry to be so long in answering.

John W. Vinson[MVP]
 
Back
Top