how to generate a 4 digits long autonumber!

CSCS

Registered User.
Local time
Today, 14:06
Joined
Jan 10, 2004
Messages
91
Hi all,

here's me again,

I have a question, I'm trying to generate an autonumber but of 4 digits, for example
the first one is: 0001 and autonumber 100 is: 0100, and so on

how can I do that?

any help will e very much appreciated!

Best Regards
CS.
 
Are you trying to have the db generate some kind of sequential number to be used as something like an invoice number?

kh
 
how to generate a 4 digit long autonumber!

that's exactly what i'm trying to do!
 
Do you plan on having your main invoice table set up so that you can never 'Delete' and invoice?

kh
 
Jeez, I would NEVER be so negative about a business as to plan for one of my basic identifiers to run out after 10,000 sales/purchases.

If you really need sequential AND contiguous numbering, look at the possibility of a DMax function.

As in, Next Number In Sequence = 1 + DMax( All the other numbers in sequence, table )

BUT if this is a shared DB due to having more than one Point of Sale, this can run into a problem.

NOW...

If all you need is increasing numbers but gaps don't matter, an autonumber is fine for your purposes.

Question: If you were doing this with pre-printed (paper) invoice sheets and you messed one up, wouldn't you have the same problem anyway?
 

Users who are viewing this thread

Back
Top Bottom