john_gringo
Registered User.
- Local time
- Today, 15:13
- Joined
- Nov 1, 2011
- Messages
- 87
Hi, I'm using a query to append data to a table for both invoices and credit notes in the same list.
On this table, I need to have a document number field increased based on the document type.
In this table, I have fields, DocType (values INV or CRN) and DocNumber
For DocType Invoice, I need numbering 1,2,3,4,5,6,7.........increased every time invoices are appended and
for DocType CreditNote, I need to have again numbering 1,2,3,4,5,6........increased every time credit Notes are appended.
There is a table DocumentType in the DB where I could store the last number for each type but as soon as I call it in my query DocNum+1 it stores the same value to all of the lines it appends.
Is there away to do this?
Any help will be much appreciated.
Thanks
Jiannis
On this table, I need to have a document number field increased based on the document type.
In this table, I have fields, DocType (values INV or CRN) and DocNumber
For DocType Invoice, I need numbering 1,2,3,4,5,6,7.........increased every time invoices are appended and
for DocType CreditNote, I need to have again numbering 1,2,3,4,5,6........increased every time credit Notes are appended.
There is a table DocumentType in the DB where I could store the last number for each type but as soon as I call it in my query DocNum+1 it stores the same value to all of the lines it appends.
Is there away to do this?
Any help will be much appreciated.
Thanks
Jiannis