Calculating Minutes

G

Guest

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
 
R

ruralguy via AccessMonster.com

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
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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
 
R

ruralguy via AccessMonster.com

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
 
G

Guest

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

--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 
R

ruralguy via AccessMonster.com

The format is just a display option. A DateTime field is always stored in the
same manner. This link explains more details of a DateTime field.

http://support.microsoft.com/default.aspx/kb/q130514/

As you can see from the link supplied, there is always a Date *and* a Time
portion of a DateTime field. You may want to examine your field data closer.

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?

The format for the start & end time is Medium Time.
[quoted text clipped - 21 lines]
datediff("n",#11/4/2007 23:30:00#,# 11/5/2007 01:42:00#)
132
 

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