In Our Stored procedure three input and one output
table name complaint and key field complaint_ID
Input
Now year,
Now date,
Now month,
Output
Key field(call number)
Auto generation key fields
First two letter current year, companies with current month first three letters and current date also
Last position our key fields
Numeric value starting from 0001 next record increment 1 numeric value for 0002
Example;
Input
2009
02
January
Output
09Jan020001
09Jan020002
09Jan020003
...............
................
................
09Jan02N
Next day
Start from
09Jan030001
09Jan030002
09Jan030003
...............
................
................
09Jan03N
Next month
09Feb020001
09Feb020002
09Feb020003
...............
................
................
09Feb02N