Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to sequence the primary key

Status
Not open for further replies.

jsnunez

MIS
Feb 4, 2004
72
US
Hello all

I have a table "invoices" I want to increase the Invoice number ,evey time a new invoice is added to the table. I do not want to use an autoincrease field.

How can I do that?

thanks
jsn
 
At the time the record is saved you would have to query the table with the invoices for the Max value and then increment it 1 and use that as the invoice number. If you have more than one person working in the database at once you definately have to do this at the last minute or you could end up with a duplicate.

Hope this helps.

OnTheFly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top