Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    24

    Unanswered: leading zero in 2400 hour readout

    hi guys,

    i am using a format on my time field of HHNN

    it works ok, unless it is under 1000 hrs.,
    then it just shows like 900 instead of 0900..,
    how can i format it to showw the leading zero ?

    thanks,
    kevin rea

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    From the Format Function Help:

    ...
    Hh Display the hour as a number with leading zeros (00 23).
    Nn Display the minute as a number with leading zeros (00 59).
    ...

  3. #3
    Join Date
    Oct 2003
    Posts
    24

    well,

    that is how i have the format, and it is not working..
    it won't display the leading zero.

    unless you literally mean that i have to capitalize the first H and the first N in the format statement >>????

  4. #4
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Re: well,

    Yes you must have the format like that:

    format(#7:20 AM#,"HhNn")
    will result in 0720


    Originally posted by kevinrea
    that is how i have the format, and it is not working..
    it won't display the leading zero.

    unless you literally mean that i have to capitalize the first H and the first N in the format statement >>????

  5. #5
    Join Date
    Oct 2003
    Posts
    24

    ok...

    that is pretty interesting..
    anyway, i put it in the format space under the field properties, and it
    changes it to all lower case..
    is there another way I can format it through code ?

    what i am doing is creating a new 2400 hr time field based on a current one.., so the code i am using to set the value for the new field is as follows:

    Me.StartUt = DateAdd("h", 8, StartTime)



    starttime is the name of the existing time field.
    startut is the new field in universal time.

    thanks,
    kevin

  6. #6
    Join Date
    Oct 2003
    Posts
    24

    oh....

    i think i figured it out..
    i just put this after it...

    Me.StartUt = Format(Me.StartUt, "HhNn")

    seems to work ok..
    thanks for the help.

    kevin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •