### Title

Need help with base 36 serials

### Post

Hi, I'm a filemaker newbie. I'm creating an asset management database and need to generate a 4 digit base 36 serial number. I found a great writeup in the knowledge base for making a 2 digit one with the following calculation:

SerialNum = a number field with an Auto-Enter value of Serial number with next value as 1 starting with 1

Serial (calculation with result of text) =

Middle("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", Int(SerialNum/36)+1,1) & Middle("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", Mod(SerialNum,36)+1,1)

It works great, BUT, I need to expand it to 4 digits and so far everything I've tried has been a bust (I can get a 4-digit number, but it looks like 111Z then 222Z or something along those lines). I think I'm missing something simple, but have no clue what it is...

Can anybody help me out?

thanks!

Middle("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Div (SerialNum ; ( 36^3 ) ) + 1 ; 1 ) &

Middle("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Div ( Mod (SerialNum ; ( 36^3 ) ) ; ( 36^2 ) ) + 1 ; 1 ) &

Middle("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Div ( Mod ( SerialNum ; ( 36^2 ) ) ; 36 ) + 1 ; 1 ) &

Middle("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Mod ( SerialNum ; 36) + 1 ; 1 )