Warm tip: This article is reproduced from serverfault.com, please click

Creating an auto increment ID in bill

发布于 2020-11-26 12:01:02

i want to create an auto increment Fact id but the problem the fact id should be like this FA001 how to increment it every time when i save a fact

Questioner
Oussama Hamadi
Viewed
0
Oussama Hamadi 2020-11-29 02:48:50

i use this methode

string bill ="fa"

string Num = "001"

for i As integer = 0 to .Numcount -1

Num = val(Num)+1

if (Num.length >= 3 ) then

bill = bill & "Num"

else

Num= "0" & Num end if

next