Help with using DURATIONS

  • I am building a database for a timed motorcycle competition. The times need to be entered as minutes, seconds, and partial seconds. For example, 02:03.62 would be two minutes and 3.62 seconds. I cannot get Access to recognize such an entry as a duration. All it wants to read it as is the time, as in 2:03:62am. Can someone please tell me how to format this column in the table. I tried it as text, which would obviously work, but I have to do calculations with the times, therefore it has to be a number. Any help would be great!


  • Actually, Access will store time up to pretty much as many digits as you want to calculate. All date/time data is actually being stored as numbers, where a day = 1 and so an hour = 1/24, etc.

    When you use the timer to time procedures and such, you can see this:

    Public Sub TimeMe()

    Dim sngStart as single, sngFinish as single

    sngStart = Timer

    'do some stuff

    sngFinish = Timer

    Debug.Print "that stuff took " & (sngFinish - sngStart) & " seconds."
    End Sub

    The trick is how to enter the data, of course, and off the top of my head I'd agree with what the other posts suggest. Though if you were using your application to do the actual timing, you could use command buttons to start and stop, and store the difference, just like in the procedure above.


  • Yes, Mac is correct...access does not support fractions of seconds. You only choice is seperate fields. It could be done with only 2 fields, minutes, and seconds with seconds as a single or double data type to allow fractions. Or you can have a single text field, and convert it to 2 fields for calculations, and put it back together for display/reporting purposes. Either way I would suggest writing a function to handlge the calculations.


  • I do not think there is a way to tell access to calculate using base 60. That is why I suggested writing the function(s) to do your calculations setup the functions that you need, and then you can call them from any form, query, or report as needed.


  • i can't think of a way to get Acces to understand your time format.

    the best way to do calculations will be to use 3 fields, one for minutes, one for seconds, and one for fractions-of-seconds.

    for faster data entry, have code in the AfterUpdate event of each box to test IF the field is (logically) filled and complete, THEN set the focus to the next field.

    hth,
    mac


  • Thanks for the suggestions. Is there a way to make Access "think" in base 60? That would solve my calculation problems, except for the fractions of seconds. The easiest thing would be to use stopwatches that do the time in all seconds, but we have never been able to find one. The only reason this is needed is so that there is no need to convert minutes/seconds to seconds only and remove the potential for human error. I'm beginning to think it's just too much trouble, but it's now a quest and I'm takin' it personal!

    Again, thanks for the help.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Help with using DURATIONS , Please add it free.

    My rights and duties- employer asks me to provide testimony in its civil lawsuit TU Settlement - Credit Inqury on my credit report