Calculate Time Using Minutes and Seconds Only

V

Val@AGIS

I am trying to calculate a race time using just Mins and Secs to give the
overall race time . How can I format my fields to show only mins and secs
without Access trying to convert to Hour Mins and secs when the mins are 60
or more.

Val@AGIS
 
J

John W. Vinson

I am trying to calculate a race time using just Mins and Secs to give the
overall race time . How can I format my fields to show only mins and secs
without Access trying to convert to Hour Mins and secs when the mins are 60
or more.

Val@AGIS

Access Date/Time fields are designed for storing a specific point in time, and
not really suitable for storing durations. For something like a race time, I'd
really suggest storing it in a Number field storing the total seconds (which
you can derive using DateDiff("s", [starttime], [endtime]) if you have fields
for those points).

If you only want accuracy to the nearest second, you can use Long Integer
(default) numbers; if sub-second accuracy is needed use a Double.

To display a racetime in minutes and seconds use an expression like

[racetime] \ 60 & Format([racetime] - 60*([racetime] \ 60), ":00")

Use ":00.00" as the format for hundredths of a second.
 

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