Manage Learn to apply best practices and optimize your operations.

# Unique sequential numbers for Web-based form

## This code calulates a totally unique, sequential, 8 digit number for Web forms.

This Content Component encountered an error

This code calulates a totally unique, sequential, 8 digit number for Web forms.

This number also allows for forms that are created at the same time. All forms will be unique accoring to the calulation below.

REQUEST NUMBER CALCULATION

This request number formula will produce a unique sequential number for each request.
EXAMPLE:

```1A44-316I

1  A  44 - 316  I
A  B  CC - CCC  D

A = The current month.
The month of October is X.
The month of November is Y.
The month of December is Z.
October , November , December are represented by letters because they are  2 digit months.

B = The current day.
Two digit days are represented by letters.
Example: day10=A , day11=B , day12=C  etc.

CC-CCC = Number of seconds past 12:00 AM of the current day.
There can be up to 86400 seconds in a day. So there needs to be 5 digits to account for.

D = Random Alpha Character.
To distinguish requests created at exactly the same second.

1 A 44-316 I

1=Month(January)
A=Day(10)
44-316=Time(12:18:36 or 43200+1080+36)
I=random alpha

Code: REM "REQUEST NUMBER CALCULATION";
REM ;
REM "This request number formula will produce a unique sequential number  for each request.";
REM ;
REM ;
REM "1A44-316I = January, 10 12:18:36 PM = 43200+1080+36";
REM ;
REM "1 A  44 - 316  I";
REM "A B  CC - CCC  D";
REM ;
REM ;
REM "A = The current month. ";
REM "The month of October is X.";
REM "The month of November is Y.";
REM "The month of December is Z.";
REM "October , November , December are represented by letters because they are  2 digit months.";
REM ;
REM ;
REM "B = The current day.";
REM "Two digit days are represented by letters.";
REM "Example: day10=A , day11=B , day12=C  etc.";
REM ;
REM ;
REM "CC-CCC = Number of seconds past 12:00 AM of the current day.";
REM "There can be up to 86400 seconds in a day. So there needs to be 5  digits to account for.";
REM ;
REM ;
REM "D = Random Alpha Character.";
REM "To distinguish requests created at exactly the same second.";

REM "Get the current year.";
year:=@Text(@Year(@Now));

REM "Get the current month.";
month:=@Right( ("0"+@Text(@Month(@Now))) ; 2);

REM "Get the current day.";
day:=@Right( ("0"+@Text(@Day(@Now))); 2);

REM "Get the current seconds past 12:00 AM this morning.";
start:=@TextToTime(month+"/"+day+"/"+year+" 00:00:00 AM");
fin:=@Now;
csc:=@Text((fin-start));

REM "Make the month a 1 digit character";
m := @If(
month = "10" ; "X" ;
month = "11" ; "Y" ;
month = "12" ; "Z" ;
@Right(month;1));

REM "Make the day a 1 digit character";
d:=@If(
day="10";"A";
day="11";"B";
day="12";"C";
day="13";"D";
day="14";"E";
day="15";"F";
day="16";"G";
day="17";"H";
day="18";"I";
day="19";"J";
day="20";"K";
day="21";"L";
day="22";"M";
day="23";"N";
day="24";"O";
day="25";"P";
day="26";"Q";
day="27";"R";
day="28";"S";
day="29";"T";
day="31";"U";
day);

REM "Add leading zeros for the current seconds past 12:00 AM if necessary.";  c:=@Right("0000"+csc;5);
c1:=@Left(c;2);
c2:=@RightBack(c;2);

REM "Calculate a random alpha character.";
rand:=@Right(@Unique;1);
r:=@If( rand = "0" ; "A";
rand = "1" ; "B";
rand = "2" ; "C";
rand = "3" ; "D";
rand = "4" ; "E";
rand = "5" ; "F";
rand = "6" ; "G";
rand = "7" ; "H";
rand = "8" ; "I";
rand = "9" ; "J";rand);

REM "Display request number...";
m+d+c1+"-"+c2+r
```
This was last published in January 2002

#### Start the conversation

Send me notifications when other members comment.

## SearchWindowsServer

• ### Roll your own Windows patching tool with PowerShell

This tutorial based on PowerShell helps administrators build an automated routine that audits Windows machines, then applies ...

• ### Server Core management remains a challenge for some

Server Core, the minimal Windows Server deployment, removes some admins from their GUI comfort zone, but its benefits reduce some...

• ### Meltdown and Spectre vulnerabilities dominate January Patch Tuesday

Complications surrounding the fix for the Meltdown and Spectre microprocessor architecture flaws will make the patching process ...

## Search400

• ### iSeries tutorials

Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

• ### V6R1 upgrade planning checklist

When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

• ### Connecting multiple iSeries systems through DDM

Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

## SearchDataCenter

• ### Three requirements for a hybrid cloud computing deployment

As the hybrid cloud computing approach gains steam, organizations will need to pay close attention to cross-cloud connectivity ...

• ### Five debunked myths about SSD issues

Solid-state drives are mature now, and the technology has eclipsed hard disk drives with superior performance, manageability and ...

• ### Future data center trends hinge on the edge, cloud and staffing

Edge computing, colocation, cloud and IT staffing issues lead the way as industry analysts make their predictions for the future ...

## SearchExchange

• ### Compliance Manager tool aims to ease security audit process

Administrators who wrestle with compliance tasks in Office 365 and Azure workloads might find some relief with Microsoft's ...

• ### Set Office 365 group limits to avoid administrative hassles

With help from PowerShell, administrators can tailor Office 365 Groups to develop common-sense restrictions on the tools and ...

• ### The top Exchange and Office 365 tutorials of 2017

Exchange Server remains a solid messaging choice, but interest in Microsoft's cloud platform shows no sign of abating. These ...

## SearchContentManagement

• ### Intelligent information management the next wave for ECM

In a 2018 upgrade, M-Files allows users to search for content in multiple repositories, while also being able to automatically ...

• ### SharePoint integration and implementation best practices

Here are some expert advice and tips, as well common definitions, to help make your SharePoint integration and implementation a ...

• ### SharePoint branding capabilities get a facelift

Since Microsoft Ignite last September, SharePoint Online is getting new branding capabilities that have been on the wish lists of...

Close