time format

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.
 
R

Rick Brandt

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.
 
J

jmonty

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.
 
B

Big Al

-----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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top