Calculate time (1 Viewer)

gmazza76

New member
Local time
Yesterday, 20:34
Joined
May 23, 2014
Messages
11
Good afternoon,

I have created a query that calculates time, but it doesnt appear correct I think.

In my source table ([time]) I am calculating the time spent that has been registered for jobs completed in a day, which seems to work but my times calculated together show as "5.71759259259259E-03".

How would I get the query to show these as 00:00:00 for the day?

thanks in advance
 

plog

Banishment Pending
Local time
Yesterday, 22:34
Joined
May 11, 2011
Messages
11,638
Here's a thread that can help with the format:


However 5.71E-03 is equivalent to about .00571. You didn't provide units or how you did the calculation so I don't know if that is correct or not.
Does that number sound correct? If not, you need to work on the calculation as well.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 11:34
Joined
May 7, 2009
Messages
19,231
you google DateDiff() function, so you can provide "unit" when calculating difference:
if you want to get difference in seconds:

=DateDiff("s",[TimeIn], [TimeOut])
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 22:34
Joined
Feb 28, 2001
Messages
27,140
First, 5.71E-03 is about 8.22 minutes. When you work with dates, you should know that they are in units of DAYS, so that is merely a small fraction of a day. If you fed that time to a FORMAT function with a time-based format choice, it would probably respond with 00:08:13 (approximately). When you directly subtract one date field from another (which technically IS valid), you get a difference in days and fractions of a day in DOUBLE format.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 23:34
Joined
Feb 19, 2002
Messages
43,223
Here's a database with some useful date functions.

 

Users who are viewing this thread

Top Bottom