Store 00:59:00 time in vb6 and access database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samvb
    New Member
    • Oct 2006
    • 228

    Store 00:59:00 time in vb6 and access database

    Hi,

    I am working on a small vb6 and access project and I am totally crazy over the way time works!

    There are runners and I need to store the time it took each runner to complete the race. If the athlete plays wonderfully, the committee gives him/her a bonas seconds (1-59). Then it arranges the players in order: the one who finishes first (with added seconds, if given any) comes first.

    It works very fine for athletes who finish after at least one hour. But if say, the athlete finishes in 00:59:00 seconds, it doesn't work! To avoid access from changing such hours to 12..., I changed the column to text field. So, it does store it as 00:00 but when I do the math from vb 6 using dateformat, it converts it back to 12 and the athlete goes to the last of row.

    My english is not good. Hope you understood me.
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    Is it possible to store the hours, minutes and seconds in 3 different feelds and calculate the time for each athlete in seconds ?
    like :
    ATHLETEtime = (HOURS * 3600) + (MIN * 60 ) + SEC

    How do You get Your data from Access ? is it a string like "00:00:00" ?
    Then You can still isolate the Hours, minutes and seconds by SPLIT in an array and calculate the seconds for each athlete.

    Comment

    Working...