Calculating Minutes

S

Secret Squirrel

I have a table with a start time and an end time. Both are set to medium time
format. What I want to do is calculate the minutes between both the start and
end times.
For example:

6:00 am - Start Time
7:00 am - End Time

I want it to show 60 minutes.

Here's what I'm using but it's not working properly:

=DateDiff("n",[StartTime],[EndTime])/60
 
S

Secret Squirrel

Not sure really. I thought that's how I needed to set it up. That link just
shows how to format it. How do I set up the calculation? If I'm not supposed
to use the "60" then how do I set it up?

ruralguy via AccessMonster.com said:
Why are you dividing by 60?? "n" tells DateDiff that you want the results in
minutes.

Here's a link with some additional data:
http://www.mvps.org/access/datetime/date0004.htm

Secret said:
I have a table with a start time and an end time. Both are set to medium time
format. What I want to do is calculate the minutes between both the start and
end times.
For example:

6:00 am - Start Time
7:00 am - End Time

I want it to show 60 minutes.

Here's what I'm using but it's not working properly:

=DateDiff("n",[StartTime],[EndTime])/60
 
F

fredg

I have a table with a start time and an end time. Both are set to medium time
format. What I want to do is calculate the minutes between both the start and
end times.
For example:

6:00 am - Start Time
7:00 am - End Time

I want it to show 60 minutes.

Here's what I'm using but it's not working properly:

=DateDiff("n",[StartTime],[EndTime])/60

=DateDiff("n",[StartTime],[EndTime])
is all you need.

Your dividing by 60 will return the value in hours.
60/60 = 1

? datediff("n",#06:00:00 am#,# 07:00:00 am#)
60

datediff("n",#11/4/2007 23:30:00#,# 11/5/2007 01:42:00#)
132
 
S

Secret Squirrel

Here's what I'm using as the formula:

=DateDiff("n",[StartTime],[EndTime])

When I calculate the difference in minutes between 6:00 am & 7:00 am I get a
result of 1440. How is that possible?

ruralguy via AccessMonster.com said:
Why are you dividing by 60?? "n" tells DateDiff that you want the results in
minutes.

Here's a link with some additional data:
http://www.mvps.org/access/datetime/date0004.htm

Secret said:
I have a table with a start time and an end time. Both are set to medium time
format. What I want to do is calculate the minutes between both the start and
end times.
For example:

6:00 am - Start Time
7:00 am - End Time

I want it to show 60 minutes.

Here's what I'm using but it's not working properly:

=DateDiff("n",[StartTime],[EndTime])/60
 
S

Secret Squirrel

Here's what I'm using as the formula:

=DateDiff("n",[StartTime],[EndTime])

When I calculate the difference in minutes between 6:00 am & 7:00 am I get a
result of 1440. How is that possible?

The format for the start & end time is Medium Time.


fredg said:
I have a table with a start time and an end time. Both are set to medium time
format. What I want to do is calculate the minutes between both the start and
end times.
For example:

6:00 am - Start Time
7:00 am - End Time

I want it to show 60 minutes.

Here's what I'm using but it's not working properly:

=DateDiff("n",[StartTime],[EndTime])/60

=DateDiff("n",[StartTime],[EndTime])
is all you need.

Your dividing by 60 will return the value in hours.
60/60 = 1

? datediff("n",#06:00:00 am#,# 07:00:00 am#)
60

datediff("n",#11/4/2007 23:30:00#,# 11/5/2007 01:42:00#)
132
 
S

Secret Squirrel

ok then why am i getting that as a result if I'm only calculating 1 hour
which should be only 60 minutes?

ruralguy via AccessMonster.com said:
There are 1440 minutes in 24 hours if that helps.

Secret said:
Here's what I'm using as the formula:

=DateDiff("n",[StartTime],[EndTime])

When I calculate the difference in minutes between 6:00 am & 7:00 am I get a
result of 1440. How is that possible?
Why are you dividing by 60?? "n" tells DateDiff that you want the results in
minutes.
[quoted text clipped - 15 lines]
=DateDiff("n",[StartTime],[EndTime])/60
 

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