display double digit number

jasn_78

Registered User.
Local time
Tomorrow, 10:36
Joined
Aug 1, 2001
Messages
214
hey guys i have the following line in my query for removing seconds from a time/date stamp and all works great except one thing if the time is 10:02 it is showing as 10:2 anyway of getting it showing correctly?

(Day([HTRXTBL].[HTRX_TIMESTAMP]) & "/" & Month([HTRXTBL].[HTRX_TIMESTAMP]) & "/" & Year([HTRXTBL].[HTRX_TIMESTAMP]) & " " & Hour([HTRXTBL].[HTRX_TIMESTAMP]) & ":" & Minute([HTRXTBL].[HTRX_TIMESTAMP]))))
 
Wrap it in the Format function:

Format(FieldName, "00")

Frankly you could probably do the whole thing with one use of the format function, with the appropriate function. More info in Help.
 
thanks pbaldy i will have a gander at it
 
Sorry, I meant format rather than function:

"...with the appropriate function"

the second argument of the Format function is a string that determines the format.
 
so pbaldy something along the lines of Format(timeStamp,"dd/mm/yy:hh:mm:)?
 
Yes, though minutes are n rather than m (month is m).
 
thanks mate much easier and simpler than what i had :)
 

Users who are viewing this thread

Back
Top Bottom