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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Division by zero 4
Multiple rows to one column 6
Which sintaxe? 7
HELP! importing spreadsheet data 4
Show me your highest mileage HDD? 0
Problem with a query 1
Calculate After hours 3
Help 1

Back
Top