Formating Time in min:sec.hundreds of second

B

Bud

I am trying tocreate a DB to record swim times in
mm:ss.hundreds of a second. I am having trouble with the
format.
Any Ideas

Bud
 
M

Marshall Barton

Bud said:
I am trying tocreate a DB to record swim times in
mm:ss.hundreds of a second. I am having trouble with the
format.

What type of field are the times strored in?

How are the times entered?
 
D

Douglas J. Steele

The Date/Time data type doesn't have that kind of resolution (plus it isn't
intended to be used for time durations: it's for timestamps, or specific
points in time)

Try storing the times in Long Integers as hundredths of seconds, then write
your own function to format the hundredths of seconds to mm:ss.hhh

You can accept the input in that format in an unbound textbox, and translate
it to hundredths of seconds, storing the translated value in a hidden bound
textbox so it'll all be transparent to the user.
 
B

Bud

Hi Marsh:
Entering times into date/time fields, but unable to
format for 100 of seconds
Entered as
01:23.95
That would be 1 min , 23 seconds and95 hundreds of a
second.

Any ideas
Thanks
Bud
 
B

Bud

Appreciate you response I will give it a try.

Bud
-----Original Message-----
The Date/Time data type doesn't have that kind of resolution (plus it isn't
intended to be used for time durations: it's for timestamps, or specific
points in time)

Try storing the times in Long Integers as hundredths of seconds, then write
your own function to format the hundredths of seconds to mm:ss.hhh

You can accept the input in that format in an unbound textbox, and translate
it to hundredths of seconds, storing the translated value in a hidden bound
textbox so it'll all be transparent to the user.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)






.
 
M

Marshall Barton

Bud said:
Hi Marsh:
Entering times into date/time fields, but unable to
format for 100 of seconds
Entered as
01:23.95
That would be 1 min , 23 seconds and95 hundreds of a
second.


As Doug explained, Date/Time fields don't allow for
hundredths of a seond. There are several ways to approach
this, depending on what the users want to do. Three
separate fields and corresponding text boxes is one way.
Another is as Doug suggested, use an unbound text box
(without a format) and then use code to parse the time into
a numeric value. Maybe a double for the number of seconds
(e.g. 83.95 for your example above) or a long integer for
the number of hundredths (e.g. 8395).
 

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