# Thread: How to input Unique Value in Invoice Number

1. ## How to input Unique Value in Invoice Number

I have to input a Unique value into a invoice field.
The unique value cannoted be repeated in the next test run.
Else the test is going to fail.

This has to be a numeric.Is there any other option than Random number?

2. ## Re: How to input Unique Value in Invoice Number

Search this site. There was a thread on this very subject not long ago.

3. ## Re: How to input Unique Value in Invoice Number

dy = DatePart("D", Now)
If Len(dy) &lt; 2 Then
dy = "0" &amp; dy
End If
mth = DatePart("M", Now)
If Len(mth) &lt; 2 Then
mth = "0" &amp; mth
End If
yr = DatePart("YYYY", Now)
hh = DatePart("H", Now)
If Len(hh) &lt; 2 Then
hh = "0" &amp; hh
End If
mm = DatePart("N", Now)
If Len(mm) &lt; 2 Then
mm = "0" &amp; mm
End If
ss = DatePart("S", Now)
If Len(ss) &lt; 2 Then
ss = "0" &amp; ss
End If
invNo = yr &amp; mth &amp; dy &amp; hh &amp; mm &amp; ss

Mark Smith

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.