Time Field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a text box that displays a time value. the control source is a
date/time field.

the time will be in seconds, usually maybe a minute. is there a way to have
a mask or something so the value comes up as 00:01:34 or 00:00:05? (maybe
even decimal seconds, 00:00:03.453?

thanks
 
The Date/Time data type doesn't really have the capability to store decimal
seconds (well, it does, but not with any reliable resolution).

To display only the time, set the field's Format property to hh:nn:ss (don't
worry that you can't find it in the list of choices given: just type it.)
 
I have a text box that displays a time value. the control source is a
date/time field.

the time will be in seconds, usually maybe a minute. is there a way to have
a mask or something so the value comes up as 00:01:34 or 00:00:05? (maybe
even decimal seconds, 00:00:03.453?

thanks

If you're storing durations, a Date/Time field can really be less than ideal.
Date/TIme fields are best for storing a specific point in time.

You might want to consider storing the time value as a Double Float count of
seconds. You can format it for hours/minutes/seconds/fractional seconds with
an expression:

ShowTime: [duration] \ 3600 & ":" & Format(([duration] \ 60) MOD 60, "00") &
":" & Format( [duration] - (60*( [duration] \ 60)), "00.000")


John W. Vinson [MVP]
 
Back
Top