converting time to minutes

  • Thread starter Thread starter Patti
  • Start date Start date
P

Patti

I have a table where I store start time and end time for
a project. I need to be able to convert this time into
minutes per day per task. Any help will be appreciated.

Thanks, Patti
 
just subtract.

Where do you want the results? In a form? On a report?

Just add a text box with something like...

= [EndTime] - [StartTime]

Rick B


I have a table where I store start time and end time for
a project. I need to be able to convert this time into
minutes per day per task. Any help will be appreciated.

Thanks, Patti
 
Rick,
I tried this and ended up with a decimal number. I want
to pull this number into a report but I am trying to
create the time within a query.
 
Duration is a decimal number. There is no format in Access for HH:MM:SS
other than the time format. There is no "duration" format.

I guess you could do some math and convert it. I have never done it, but I
posted a suggestion about two days ago...

<------------------Text from previous post----------------------->
There should be some samples out there somewhere. Off the top of my head,
I'd probably...

1) round it to a whole number
2) subtract the rounded from the original
3) multiply by 60


for example 1.25
1) 1.00
2) 1.25 - 1.00 = 0.25
3) 0.25 * 60 = 15

Then I'd build my number such as...

[field1] & ":" & [Field3]
1:15


There may be more efficient ways, but something like that would work. I bet
you could even make a public function out of it so you could use hte math
over and over on difffernt numbers.


Rick,
I tried this and ended up with a decimal number. I want
to pull this number into a report but I am trying to
create the time within a query.
 
You can get the difference between two times by using the DateDiff function.

DateDiff("n",StartTime,EndTime)

That will give you the number of minutes between the two times. (and yes "n" is
minutes, since "m" is months).

Since I have no idea where you get a count of your tasks or the number of days
for a task or project, there is no way I can give you further advice.
 
DateTime variables and fields contain "special" floating point values
in which the whole number part is designed to correspond (for a date)
to the number of days elapsed since (from memory) December 31, 1899,
and the fractional part is the time after midnight in fractions of a
_day_.

If you are using DateTime variable to hold clock times (no whole
number part) _and_ your start and end times are always on the same day
(no crossing midnight), you can compute elapsed time, in minutes as:

(dtEndTime-dtStartTime) * 1440

If a "session" can cross midnight but is never longer than 24 hours,
you can use:

((dtEndTime-dtStartTime) + IIF(dtEndTime>dtStartTime),0,1)) * 1440

Under any other circumstances, you have to track starting date/time
and finishing date/time.


I have a table where I store start time and end time for
a project. I need to be able to convert this time into
minutes per day per task. Any help will be appreciated.

Thanks, Patti

Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
Back
Top