MadPhilly
Posts: 19
|
| Posted: 10/03/2007, 3:52 AM |
|
Hi All,
I'm creating a page that records production data from the factory. The main element is the Serial Number that we would like auto-generated. This would be simple if it were all numbers! However, our serial number has the following format.
1111A07 - Up to four digits (incremented by 1) - A letter representing the month (A = Jan, B = Feb and so on) - and the year.
Incrementing the number isn't so bad but incrementing the letter at the change of the month and incrementing the year at yearend is puzzling me.
How would I auto-generate this number?
Thanks
Andy
|
 |
 |
Oper
Posts: 1195
|
| Posted: 10/03/2007, 1:26 PM |
|
MySerial(YourNumber)
<%
response.write MySerial(45)
function MySerial(sNumber)
MySerial=sNumber & mid("ABCDEFGHIJKL",month(date()),1) & year(date())
End Function
%>
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
MadPhilly
Posts: 19
|
| Posted: 10/04/2007, 1:35 AM |
|
Thanks for your quick reply.....most appreciated!
|
 |
 |
MadPhilly
Posts: 19
|
| Posted: 10/04/2007, 2:03 AM |
|
Sorry to be a pain, but where does this go?!?!
|
 |
 |
Oper
Posts: 1195
|
| Posted: 10/07/2007, 10:31 AM |
|
create a hidden file for your SERIAL
and before show even of that TEXTBOX assign the new Value
IMPORTANT: (only assign the new value while Inserting)
use form.editmode
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
MadPhilly
Posts: 19
|
| Posted: 10/09/2007, 6:14 AM |
|
Grand job...thanks a lot.
|
 |
 |
|