Auto Calculating codes using specified algorithm.
Bit of a though request from boss, and did not want to say "Dunno how"
Each time a new product are added I must assign it a product code, which will be a 3 digit numerical code.
For the first 9 products it should be "010" to "090".
After that it should be "110" to "190", then "210" to "290", etc.
Anyone did sth like this. Bit late for me to think straight.
Re: Auto Calculating codes using specified algorithm.
So basically you just want a sequential code in multiples of 10, correct? If the data is being stored in a database then you could simply use an auto-generated ID as normal and then add an extra calculated field using an expression that multiplies the ID by 10. In SQL Server that would mean a ProductID column with (Is Identity) set to Yes and a ProductCode column with (Formula) set to 'ProductID * 10'.