time formatting

  • Thread starter Thread starter Beth
  • Start date Start date
B

Beth

I am having trouble formatting a field in a continuous form. The value is a
decimal number representing a length of time (i.e. 72.2 seconds). I would
like to continue storing the value that way, but show it in this one form
as minutes:seconds:decimal part so the above example would be 1:12:2. My
first thought was the hh:mm:ss formatting, but that doesn't give the right
answer. I would appreciate any suggestions.
Thanks,
Beth
 
Placing the following in an unbound text box would cause a value entered as
seconds to be displayed in minutes and seconds. Perhaps you can modify it
to meet your needs.


=[SomeFieldName]\60 & Format([SomeFieldName] Mod 60, "\:00")
 
Try Format(72.2/86400, "hh:nn:ss")

Format will only give you ss: you can't get tenths of seconds through
Format.
 
Assuming your times are always in seconds, this will format it like you want
it:

format(x\360,"#1:") & format(x mod 60, "00:") & format((x - int(x)) * 10, "#")

x being your number. The above is good for 1 decimal place. If you want 2
decimal places (100th of a second), make the multipler * 100 and the format
"##" in the last format. Add a 0 and a # for each decimal of precision you
want
 

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

Similar Threads


Back
Top