Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2008
    Posts
    1

    Timed events


    I am trying to build a database for a Biathlon event organizer. I can figure out what format or data type to designate a control for a final time such as 53:21 meaning 53 minutes and 21 seconds to finish the course. Also, I need to program some calculations so that we can subtract one event time from another to get the split time. In other words, we record someone's run time and their total time (running and biking), but to get the split time on the bike portion I need to be able to subtract the run time from the total time. Does Access have a provision for this keeping in mind that regular math won't work because a minute is 60 seconds long (not 100)?

  2. #2
    Join Date
    Aug 2008
    Posts
    8
    Here is sample code for calculating the time difference between two times. I use a create date field and a completed date field.

    Dim strTime As String
    Dim strTimeDiff As String

    'Timestamp the completed validation
    Me.CompleteDate = Now()

    'Find the time difference between the create date and the completed date
    strTime = DateDiff("n", Me.CreateDate, Me.CompleteDate)

    'Convert time to hours and minutes
    strTimeDiff = strTime \ 60 & " hour(s) : " & strTime Mod 60 & " minutes"

  3. #3
    Join Date
    Aug 2008
    Posts
    8
    Here is some sample code for converting two time into hours and minutes

    Dim strTime As String
    Dim strTimeDiff As String

    'Timestamp the completed validation
    Me.CompleteDate = Now()

    'Save the record
    DoCmd.RunCommand acCmdSaveRecord

    'Find the time difference between the create date and the completed date
    strTime = DateDiff("n", Me.CreateDate, Me.CompleteDate)

    'Convert time to hours and minutes
    strTimeDiff = strTime \ 60 & " hour(s) : " & strTime Mod 60 & " minutes"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Events Report, please help!
    By Suzan in forum Reports
    Replies: 3
    Last Post: 04-19-2006, 01:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums