How to calculate time difference?

B

barton

I have a table called report, and there is a column called time
the format of time is hh:mm, like 21:20
and i want to set up a query to calculate overtime
for example

Engineer time overtime
john 21:20 (this one to calculate
overtime, which is the time after 20:00)

what is the formula to calculate time?
i tried to type OT: [time]- 20:00 and it doesnt work.

so is there any method to calculate that?

thx all

--
One moment that for me epitomises my time here is when Steven Gerrard, my
new captain at the time, scored against Sofia and ran over to the touchline
to celebrate the goal with me and the staff. I want to stress again that
there is no bitterness; there is no ill feeling just a huge sadness at the
moment.
 
P

Paul Overway

Elapsed time can be calculated as follows:

([EndDateTime] - [StartDateTime]) * 24

....or you can use the DateDiff function, but be careful how you use it or
your result may be off. Note that it is assumed that your field includes
the date AND time...if it does not, you need to make some changes in your
design to allow for the possibility of work spanning multiple days.
 
B

barton

Thanks so much.. its done now!


--
One moment that for me epitomises my time here is when Steven Gerrard, my
new captain at the time, scored against Sofia and ran over to the touchline
to celebrate the goal with me and the staff. I want to stress again that
there is no bitterness; there is no ill feeling just a huge sadness at the
moment.

Paul Overway said:
Elapsed time can be calculated as follows:

([EndDateTime] - [StartDateTime]) * 24

...or you can use the DateDiff function, but be careful how you use it or
your result may be off. Note that it is assumed that your field includes
the date AND time...if it does not, you need to make some changes in your
design to allow for the possibility of work spanning multiple days.


barton said:
I have a table called report, and there is a column called time
the format of time is hh:mm, like 21:20
and i want to set up a query to calculate overtime
for example

Engineer time overtime
john 21:20 (this one to calculate
overtime, which is the time after 20:00)

what is the formula to calculate time?
i tried to type OT: [time]- 20:00 and it doesnt work.

so is there any method to calculate that?

thx all

--
One moment that for me epitomises my time here is when Steven Gerrard, my
new captain at the time, scored against Sofia and ran over to the touchline
to celebrate the goal with me and the staff. I want to stress again that
there is no bitterness; there is no ill feeling just a huge sadness at the
moment.
 

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

Top