how do i calculate minutes per mile in Access?

G

Guest

I've constructed a DB to track my running workouts. I can't seem to get
Access to calculate the minutes per mile correctly. I used short time and
short integer. Excel does it just right why can't Access?
 
F

fredg

I've constructed a DB to track my running workouts. I can't seem to get
Access to calculate the minutes per mile correctly. I used short time and
short integer. Excel does it just right why can't Access?

It would have been highly useful had you posted the expression that
you use to calculate the minutes per mile and the result that you get
as well as the result you expect. Since you haven't I can only peek
into my crystal ball and guess that you are not getting the decimal
part of the time correct. You state that you are using a "Short
Integer", whatever that is (Access integers are either Long Integer or
Integer). An Integer, by definition, is a whole number therefore it
cannot contain a decimal part. Change the Field Size to double, and
try again. If you still have a problem, post the expression as well as
some sample data.
 
P

peregenem

fredg said:
You state that you are using a "Short
Integer", whatever that is (Access integers are either Long Integer or
Integer).

Jet's data types include TINYINT (synonyms include INTEGER1 and BYTE),
SMALLINT (synonyms include INTEGER2 and SHORT) and INTEGER (INTEGER4
and LONG). These map to the VBA intrinsic data types Byte, Integer and
Long respectively. AFAIK Access has no data types of its own.

The may have meant Jet's SMALLINT but, by mentioning 'short time' I
think they may have been alluding to the SQL Server/MSDE data types
SMALLDATETIME and SMALLINT respectively.
 
G

Guest

In almost every case when someone says Access can't do it, it means they
don't know how. As previous posters have said, you didn't give any info on
what you are trying to do, exactly. I am going to guess that to calculate
minutes per mile, you want to enter the number of miles, that start time and
end time, and convert that into minutes per mile. The question is, do you
want it in minutes and seconds minutes with a decimal? For this, I will
assume seconds.

I don't know how you want to enter the data, so I will assume it will be
using normal time notation so that your entry would be in text boxes that
look like this:

Start Time 3:15:30 End Time 3:42:18 Miles 3 MPM 08:56

Your formual would be:

Me.MPM = Format( (Cdate( Me.txtEndTime) - Cdate(Me.txtStartTime)) /
Me.txtMiles, "nn:ss")
 

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