I'm trying to make a VBScript produce a counter with this format: YY/nn (16/1 - 16/2).
It has to handle numbers up to 4 characters (16/100, 16/1055).
I have found this code, who does the job, but it displays leading zeroes (16/0001), how can i remove the leading zeroes from the output and meet the requirements?
***CODE START ***
Dim yy, nn
yy = Right(Year(Date()),2)
If isnull(LastUsed) or (LastUsed="") Then
nn = 1
ElseIf Left(LastUsed,2)=yy Then
nn = CInt(Right(LastUsed,4)) + 1
Else
nn = 1
End If
Output = yy & "/" & Right("0000" & nn,4)
***CODE END***