time format

  • Thread starter Thread starter meghan
  • Start date Start date
M

meghan

I need to format a time value that measures how long
something takes in minutes and seconds. I want it to
display as 23:00 for example. So far everything I try
ends up as time of day.
 
meghan said:
I need to format a time value that measures how long
something takes in minutes and seconds. I want it to
display as 23:00 for example. So far everything I try
ends up as time of day.

The Date DataType in Access is intended to store "points in time" not "amounts of
time". Any time value over 24 hours will roll back to 12:00 and have a day added to
it. You're better of just storing a numeric value for the number of seconds and then
do the math to display it as minutes and seconds when you need to.
 
Format([StartTime] - 1 - [EndTime], "nn:ss")

In the above example StartTime and EndTime are the names
of 2 textboxes on a form. If the diff = 1 min and 10 sec,
it will display as 01:10
See Access Help under Format function> See Also> User-
defined date/time formats.
Hope this helps.
 
-----Original Message-----
I need to format a time value that measures how long
something takes in minutes and seconds. I want it to
display as 23:00 for example. So far everything I try
ends up as time of day.

.
Meghan,
I was having the axact same problem a couple of months
ago. After hours of searching on Google, I found the
answer. The key to working with date/time is
understanding how Access stores dates and times. Visit
the following link and all your questions should be
answered.

http://msdn.microsoft.com/library/default.asp?
url=/archive/en-us/dnaraccgen/html/msdn_datetime.asp
 
Back
Top