I want to count starting at 0001 not just 1

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I have a formula  ([Project Man Init] & ToText([# of Projects Snapshot] + 1) & [Project # Test] & [Revision])  and it works like its supposed to except I want it to start at 0001 and continue with the same so it would go to 0002 then 0003 and so on and so forth til 9999 and then of course go to 10000. I do not want commas or decimals.
this is all reference to ToText([# of Projects Snapshot] + 1) the Plus 1 needs to be 0001 and I tried putting 0001 in the formula and it did not work

Photo of Kenneth

Kenneth

  • 0 Points

Posted 4 years ago

  • 0
  • 1
Try this

var number RawNumber = ToText([# of Projects Snapshot] + 1) ;

Right("0000" & totext($RawNumber),4)

That should take you number, stick 0000 in front of it and then grab off the rightmost 4 characters.

So 1 becomes 00001 which becomes 0001
10001 becomes 000010001 which becomes (ie stays at) 10001
Photo of Kenneth

Kenneth

  • 0 Points
It says incorrect Variable type do I need to create a variable?
Sorry
var number RawNumber = [# of Projects Snapshot] + 1;
Right("0000" & totext($RawNumber),4)
Photo of Kenneth

Kenneth

  • 0 Points
yes works great thank you