Adding 0 if single number

April 12, 2005 by Carl Grint
I used a similar process for changing a date to ISO format.

It migh help, it looks if a number is less then 10 and if so Adds a leading 0

<% Dim ISODOB
DOBDate = DatePart("d", rsreportdetails("ClientDOB"))
If DOBDate < 10 Then
DOBDate = "0" & DOBDate
End If
DOBMonth = DatePart("m", rsreportdetails("ClientDOB"))
If DOBMonth < 10 Then
DOBMonth = "0" & DOBMonth
End If
DOBYear = DatePart("yyyy", rsreportdetails("ClientDOB"))
ISODOB = DOBYear & DOBMonth & DOBDate %> <%=ISODOB %> <% End If %>