Query Question

KevW

Registered User.
Local time
Today, 10:53
Joined
Nov 11, 2005
Messages
41
I am trying to get the folliwing DatePart query to work as I intended.

testcheck_time: DatePart("h",[EDS_testchecks]![Query_Start_Date]) & ":" & DatePart("n",[EDS_testchecks]![Query_Start_Date]) & ":" & DatePart("s",[EDS_testchecks]![Query_Start_Date])

The above works well but what it is doing is when there is a leading 0 in either the hour, minute or second data it is not displaying the zero. Is it possible to show the leading zero or is it something I will never be able to do.


Thanks
 
testcheck_time: Format([EDS_testchecks].[Query_Start_Date],"hh:nn:ss")

^
 
Thanks for that does exactly what I wanted. Would that also work on the date so that leading zeros are displayed
 
Hi -

Try it yourself. Example from debug (immediate) window:

x = now()
? x
4/7/06 5:56:04 PM
? format(x, "mm:dd:hh:nn")
04:07:17:56

As you can see, it does provide leading zeros.

Bob
 

Users who are viewing this thread

Back
Top Bottom