September 28, 200718 yr I have a database that has primary keys starting from 1 and serially incrementing by 1. Am trying to change it using Replace field contents How do I do the calculation that the final PK looks like DOC0001, DOC0002 (from 1,2...) "DOC" & (0000+PK) didnt help much
September 28, 200718 yr Just so you know ... you can enter "DOC0001" as the serial Number/Code in full and FileMaker will handle it correctly, no calculation needed. This will also prevent the forthcoming issue you will have when you hit 10+ Your current calc will result in: DOC0001 DOC00010 DOC000100 If you need the prefix to be dynamic you can use: DOC & Choose ( Length ( PK ) ; "0000" ; "000" ; "00" ; "0" ) & PK best Stuart
September 28, 200718 yr you can enter "DOC0001" as the serial Number/Code in full and FileMaker will handle it correctly, no calculation needed. Make sure the field type is Text, if you do that.
Create an account or sign in to comment