Gave this a go and couldn't initially get it to work. I'm looking to create a project number (note this is not a primary key/serial as such, but should be unique). I'd like this to be auto calculated on the creation of a new record. The format is:
Last 2 digits of current year
Followed by a 3 digit number, starting from 001 and incrementing by 1 each time
So, first record created today would be 13001, second would be 13002 and third 13003. Come Jan 1st when creating a new record it would be 14001 and then 14002. It is not expected that the number of records created in one year would ever get close to exceeding 999.
Thoughts, ideas, pointers?