Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you format a table field for MM:SS only!? 1

Status
Not open for further replies.

HMJ

Technical User
Nov 29, 2002
58
0
0
US
Hello All;

We are trying to build a table for tracking times on the Physical Fitness test. Part of the test is the time it takes to swim so many laps or to run a mile distance.

Access has time formats where it is HH:MM:SS already defined; however, we only need to keep the MM:SS. Is there a way to format a field to only the minutes and seconds parts? This would make it easier to input, track averages, etc.

Thanks.


Harry Jessen
HMJessen@Yahoo.com
 
OKAY, just came up with more information that might clarify what we are doing. The time I am trying to enter in the field is how long it took to complete the activity - the duration. I do not need a 24 hour or am/pm time system. Just entering minutes and seconds it took to complete this event.

Eventually, I need to average this out, so I really need the time format, otherwise I would just use a decimal entry.

Hope this clarifies what I am trying to do.

Thanks Again!!

Harry Jessen
HMJessen@Yahoo.com
 
Make the field type text and put 00:00 in for the input mask. This will only allow the user to input digits and automatically put the : in the field.

I have not tested this, so I don't know if this will for averaging.
 
mkov

The only problem is that we need to do mathmatical actions later on such as averages. If I make it text, I won't be able to do that.

Thanks anyway!


Harry Jessen
HMJessen@Yahoo.com
 
Store it as a date/time field. If you're going to go over 60 minutes (meaning one hour), then consider separate textboxes for the minutes and seconds bits. Then take those two textboxes and insert them into your date/time field.


Let's assume that you're staying under 60 minutes. You store it as a date/time field. If you need to know the minutes, you can do a Minute([yourfield]). If you need seconds, you can do a Second([yourfield]).

If you have longer minutes, like 87 minutes 3 seconds, then you can still store it as a date/time. You'd just have to work it a little different: DateDiff("n",0,[yourfield]) returns the total # of minutes, and DateDiff("s",0,[yourfield]) gives the total # of seconds. So you can get 1284 seconds, or whatever you need.


So store it as a date/time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top