My Assistant
![]() ![]() |
|
|
Sep 22 2011, 03:49 PM
Post
#1
|
|
|
UtterAccess Enthusiast Posts: 61 |
I am having problems dividing time by distance.
The fields are: Distance (double) Time (short time) Pace: =distance/time (short time) It should output Distance: 5 Time: 00:40:00 Pace: 00:08:00 Getting: 0:00 Please help. |
|
|
|
Sep 22 2011, 03:55 PM
Post
#2
|
|
|
Access Wiki and Forums Moderator Posts: 48,594 From: SoCal, USA |
Hi,
What version of Access are you using? If you are using a Date/Time data type to store the time, then you might have to reconsider. Date/Time data types are meant for "points in time" and not for "duration," which is what I think you want. For example, you can use a Long Integer type to store the value 40, and you won't have any problem dividing 5 with 40. To display the result in a "time" format, you can use some calculations to convert the value into the correct format. Just my 2 cents... |
|
|
|
Sep 22 2011, 03:57 PM
Post
#3
|
|
|
UtterAccess Enthusiast Posts: 61 |
Using MS Access 2010.
|
|
|
|
Sep 22 2011, 03:58 PM
Post
#4
|
|
|
Access Wiki and Forums Moderator Posts: 48,594 From: SoCal, USA |
|
|
|
|
Sep 22 2011, 06:56 PM
Post
#5
|
|
|
Retired Moderator Posts: 19,667 |
The fields are: Distance (double) Time (short time) Pace: =distance/time (short time) (short time)??? If I recall basic measurement study in primary school correctly then Pace (= Distance divided by Time) gives the speed and the unit of measurement for speed should be distance unit per (/) time unit such as miles/hour or m/minute. The unit of measurement for speed is never just time unit, e.g. "short time", AFAIK. Thus, interpreting the resultant Pace value as time is certainly incorrect and may display unexpected value, e.g. or behaviour that you experienced... |
|
|
|
Sep 22 2011, 08:09 PM
Post
#6
|
|
|
Retired Moderator Posts: 19,667 |
Did you mean to calculate the time it takes to travel one unit of length by any chance?
If yes, then I think the calculation should be time (duration) divided by distance and the unit of measurement would be time unit per (/) unit of length, e.g. minutes/mile, which is more like your description and the result is 8 minutes for each unit of distance given that it takes 40 minutes to travel the distance of 5 units of length. |
|
|
|
Sep 22 2011, 10:49 PM
Post
#7
|
|
|
UtterAccess VIP Posts: 3,050 From: Perth, Australia |
Agree, you cant use date stamps for this, they need to be numbers. You can express the number later as hours/minutes/seconds etc, but only if you know what the number represents first, ie is it seconds elapsed, minutes elapsed, days?
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th June 2013 - 07:48 PM |