Format Table data type for time

F

Frank

I want to use time in the following way. An athlete runs a time of 1minute 30
seconds and split seconds of 2/3 100th of a second for example: I want to use
the time as follows 01:30.66 [This must be the way one have to input the time
in a form and use it in a query. How do I format the data type to use this
time in calculations. Example fastest and slowest and also sorting the times
from fast to slow ect.
 
N

Noëlla Gabriël

Hi Frank,

the access date/time data type isn't really suited to display 100th of
seconds, you'll have to use a separate field for it. You can display minutes
and seconds in a date/time filed, but in this case I think you better store
the data in 3 separate fields: 1 for the minutes, one for the seconds and 1
for the 100ths of seconds.
You can use 3 numeric fields (integers) and limit their values the seconds
field to 59 and the 100ths field to 99.
In reports you can concatenate the numbers to one expression.
 
J

John W. Vinson

I want to use time in the following way. An athlete runs a time of 1minute 30
seconds and split seconds of 2/3 100th of a second for example: I want to use
the time as follows 01:30.66 [This must be the way one have to input the time
in a form and use it in a query. How do I format the data type to use this
time in calculations. Example fastest and slowest and also sorting the times
from fast to slow ect.

Access Date/Time fields don't really lend themselves to storing durations; for
one thing they're limited to 1 second granularity.

Rather than storing in a Date/Time field I'd suggest using a Number, Single
(rather than the default long integer) number of seconds. 1:30.66 would be
stored as 90.66. You can display it in n:ss.ss format using an expression like

[Runtime] \ 60 & ":" & Format([Runtime] - [Runtime] \ 60, "00.00")

and you can use two unbound textboxes on a form to enter minutes and seconds,
with a bit of code to combine them.
 

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