I have a query that is appending new records to another table, the problem is that for unique records I need to assign a unique number to a field. I have figured out that I can get the last number using DMAX, and I just want to add 1 number for record that I am adding. The field is a ship_to_key field and the field must be unique for every cust_key field ie. you can have the same ship_to_key as long as it has a different cust_key. The table I am adding the new records to is ARSHIP. The table I am adding from OWHeader.
OW Header
Cust Key Ship Address
OWSIN 123 Anywhere
OWSIN 158 Place
OWSIN 357 Street
OWSIN 678 Ave
ARSHIP
Cust Key Ship_to_Key Ship Address
OWSIN 001 123 Anywhere
OWSIN 002 158 Place
OWSIN 003 357 Street
OWSIN 004 678 Ave
The Ship_to_Key is a string field
Any help would be appreciated
Thanks in advanced
OW Header
Cust Key Ship Address
OWSIN 123 Anywhere
OWSIN 158 Place
OWSIN 357 Street
OWSIN 678 Ave
ARSHIP
Cust Key Ship_to_Key Ship Address
OWSIN 001 123 Anywhere
OWSIN 002 158 Place
OWSIN 003 357 Street
OWSIN 004 678 Ave
The Ship_to_Key is a string field
Any help would be appreciated
Thanks in advanced