Ms-access – MS Access Data Type for time in hh:mm:ss format

importms accesstime

My database contains three different sporting events with finishing times imported from an Excel spreadsheet in the hh:mm:ss format.

How do I customize the Access data type field to accept this format? Additionally, I then need to add three different event times per participant to create a total time, but need assistance in the format.

Best Answer

You can store the data in Excel as the amount of time from the default date. If you just enter the time in the format you wish, it will automatically add the default date. Enter "4:30:00" as in [FinishTime] and it will save the data like in [Unformated Date], but will be visible format you wish and retain the proper time value.

http://i.imgur.com/8dR0iO4.jpg

When you create the table in Access you can just change the format to change how it displays itself. Note, in access Minutes are stored as "nn" instead of "mm", distinguishing it from Months.

http://i.imgur.com/Xj0LSxl.jpg

It will look the way you want. Note, although the unformatted default date will appear different in Access than it will in Excel, the time will remain relative to the default start point.

http://i.imgur.com/matK6e3.jpg

From there, simply import your Excel into the Access table normally or enter the time in the same "hh:mm:ss" directly into the Access table.

When you want to see the data summed up, you can do so in a query, making sure you convert it to a date and format it to display how you wish.

In this case:

Format(CDate(Sum([FinishTime])),"hh:nn:ss")

http://i.imgur.com/1ZWRNhE.jpg

Resulting in the total time that you wish

http://i.imgur.com/fHPC4kw.jpg

If you anticipate the total time going over 24 hours, there are more things to consider, but it doesn't sound like this project will.