time format

S

Sue

I am trying to design a database that will hold results
for races so I only want the time to hold minutes and
seconds. I have tried setting the date/time field
property to nn:ss to hold just minutes and seconds but it
still defaults it to hours, minutes and seconds by
putting what I enter as minutes as hours and what I enter
as seconds as the minutes. How do I get the field to
just hold minutes and seconds as I enter it so that I can
eventually sort all the results into order to find
winners etc.
 
J

Jeff Boyce

Sue

Access' Date/Time fields do NOT hold amount (minutes, hours, ...) -- they
hold "point in time" data.

If you need to store amount, you'll have to use either a text field (store
whatever, and parse into numeric data), or numeric fields (one for hours,
one for minutes, one for seconds, ?one for hundredths?).

Good luck

Jeff Boyce
<Access MVP>
 
D

Douglas J. Steele

Another option for times is a single numeric field, and store in whatever
the finest granularity is. For example, to be able to display nn:ss, store
the times as seconds, and write your own function to format total seconds as
nn:ss

Function FormatTotalSeconds(NumberOfSeconds As Long) As String

FormatTotalSeconds = Format(NumberOfSeconds \ 60, "0") & _
":" & Format(NumberOfSeconds Mod 60, "00")

End Function
 

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