View Full Version : Ref numbers

01-16-2008, 11:34 AM

We are currently building a system where a user can submit a request and is given an automated ref number ie 1001 (we are using identity in sql to auto generate the ref number). If that request gets rejected a user can resubmit the request by entering their ref number which will bring up their previous request, amend it and submit it again however when they submit it it adds an a, b, c etc to the end of the request ie 1001a. We have created a separate table in the db to hold the re-submitted requests so as not to overwrite the previous requests and so it doesn't autogenerate a new number when another row is added to the table and so we can hold the alphanumeric characters.

Is this the right way to go about it? Can anyone give us an idea on how to add the alphanumeric character to the end of the ref number?

Many thanks

Whatever Jr.
01-16-2008, 12:29 PM
Do a select count of all the requests with the same ref number.
If you have 4, the next one will be 5. Use the 5th letter of the alfabet.

But what happens when the 27th amendment happens?