Skip to main content
Question

Best format for Unique Number Generation

  • November 29, 2018
  • 0 replies
  • 98 views

I am in need of unique numbers for multiple different tables and am wondering what the best format is for the structure. 

So far I know that I will need to track a letter to correspond to the table. I will also need to track a year, a month, and a constant four digit section containing the record Id, padded with leading zeroes. 

My specific question is, for searchability, etc. Should I put the letter and/or date at the end or the beginning. 

Example:      Q18290001  vs  00011829Q  ??

Any thoughts? Pros, cons? 

Thanks for any advice. 


PS, current code looks like this-->

"Q" & Right(ToText(Year([Quote Date])),2) & If(Month([Quote Date]) < 10, "0", "") & ToText(Month([Quote Date])) & Right("00000" & ToText([Record ID#]), 4)
This topic has been closed for replies.

I would put the [Record ID#] portion last and I would suggest for human readability having some dashes or at least a space to separate the elements.

Q-18-03-1234

I would also suggest to zero pad the month like i did above