If someone could provide me with a sample, I can figure out the rest. I need to read from one table find the first occurence in the second table and create a third table with results and update both table 1 & 2. See brief scenario below: Thanks!!!
I have 2 tables in Access. In 1 table I have invoice info for acct#1 (acct#,Inv#,product,sales year&month,qty). I receive a file from acct#1 when they distribute the product we sold to them to other accts. When they do this, I need to reduce acct#1 sales by creating a reversing invoice and creating an invoice for acct#2, acct#3, etc. See sample data below.
Acct#1 (File#1)
Acct# Prod Inv# Year Mth Qty
11111 xxxx 1234 2002 01 5
11111 xxxx 2345 2002 01 10
11111 xxxx 3456 2002 02 20
Acct#1 sends file with following tracings. (File#2)
Acct# Prod Year Mth Qty
22222 xxxx 2002 01 10
33333 xxxx 2002 02 5
44444 xxxx 2002 02 2
I would like to generate the following.
Acct# Prod Inv# Year Mth Qty
11111 xxxx 1234 2002 01 -5
11111 xxxx 2345 2002 01 -5
11111 xxxx 2345 2002 01 -5
11111 xxxx 3456 2002 02 -2
22222 xxxx 1234 2002 01 5
22222 xxxx 2345 2002 01 5
33333 xxxx 2345 2002 01 5
44444 xxxx 3456 2002 02 2
The month that acct#1 purchased and then reported will not always be the same, as my example shows. I want to back out of acct#1 in the month they purchased it and add to acct#? in the month that acct#1 shipped it to them.
How can I do this using Access?
I have 2 tables in Access. In 1 table I have invoice info for acct#1 (acct#,Inv#,product,sales year&month,qty). I receive a file from acct#1 when they distribute the product we sold to them to other accts. When they do this, I need to reduce acct#1 sales by creating a reversing invoice and creating an invoice for acct#2, acct#3, etc. See sample data below.
Acct#1 (File#1)
Acct# Prod Inv# Year Mth Qty
11111 xxxx 1234 2002 01 5
11111 xxxx 2345 2002 01 10
11111 xxxx 3456 2002 02 20
Acct#1 sends file with following tracings. (File#2)
Acct# Prod Year Mth Qty
22222 xxxx 2002 01 10
33333 xxxx 2002 02 5
44444 xxxx 2002 02 2
I would like to generate the following.
Acct# Prod Inv# Year Mth Qty
11111 xxxx 1234 2002 01 -5
11111 xxxx 2345 2002 01 -5
11111 xxxx 2345 2002 01 -5
11111 xxxx 3456 2002 02 -2
22222 xxxx 1234 2002 01 5
22222 xxxx 2345 2002 01 5
33333 xxxx 2345 2002 01 5
44444 xxxx 3456 2002 02 2
The month that acct#1 purchased and then reported will not always be the same, as my example shows. I want to back out of acct#1 in the month they purchased it and add to acct#? in the month that acct#1 shipped it to them.
How can I do this using Access?