Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating total time
Message
De
05/09/2001 14:15:24
 
 
À
05/09/2001 09:53:25
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00552478
Message ID:
00552710
Vues:
14
>In my application, I will have a field in an Access datatbase that will store the time it takes for a user to complete an external process. The duration will be presented from different devices via the serial port, and will come in different formats (ie.. HHMMSS....HMMSS). My question is, what will be the best format to place this duration time into, in the database, and what is the best method to add all of a users duration times together, for a total time and avg time?
>
>
>Randy

You can store this on a date/time type field on an Access mdb, you just need to add the date. If the date is the same (and using VB6) you can use direct date arithmetic to calculate the time elapsed between two datetime values and then format it like so:
Format$(StartDate - EndDate, "hh:mm:ss")
If it falls on a different date, you can probably use a combination of DateDiff() & DateAdd(). Although for something like this you would probably need to calculate the necessary intervals separately (days, hours, minutes and seconds) and then construct a date var with that to feed to the DateAdd.
HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform