CUSTOM FORMAT NUMBERS
I have a need for a custom number format - for a companies JOBNUMBER (for internal tracking)
This number is a collection of day/month/job .. ie: for today 29 Mar .. the number would be 2903-01
Ive used <%=Day(now())&Month(now())%>-01 .. which works great, If all the days & months use a double digit.
This If I use the above code, I get '293-01' - when Id need '2903-01'
Is there a way that If the month or day value are single digits, that it would add a 0...
Thanks in advance
Justin (South Africa)
Comments
Adding 0 if single number
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 %>
You must me logged in to write a comment.