JohnnyBGood
Registered User.
- Local time
- Today, 01:51
- Joined
- Jun 15, 2011
- Messages
- 19
Hi,
I want to create an append query to add a record to our Bills of Material.
We have several bills of material that we want to add a part to the bottom of the bill.
So basically I am querying a Requirement table that lists all the parts in a BOM by BOM base id... so I have one field which lists the Base ID and it will be repeated as many times as there are parts in that BOM, then it goes to next Base ID and so on...
Each Part ID has a unique Piece Number field within each Base ID. I want to be able to identify the last Piece Number per Base_ID and add 10 to it, and that is the record I will append with a specific part number. (the same part number is to be added to the bottom of each BOM (Base Id grooup).
Is this possible?
Example of my table
BASE_ID PART_ID PIECE_NO
1234 xx1 10
1234 xx2 20
1234 xx3 30
1234 xx4 40
2345 yy1 10
2345 yy2 20
2345 yy2 30
So I want to identify that 40 is the last Piece_No for Base_Id 1234 and add 10 to it (to give me 50) and for Base_ID 2345, 30 is last Piece_no. I want to add 10 to get 40.... and make those the new Piece_No for new records with a new part zz1 to both these Base_IDs
I want to create an append query to add a record to our Bills of Material.
We have several bills of material that we want to add a part to the bottom of the bill.
So basically I am querying a Requirement table that lists all the parts in a BOM by BOM base id... so I have one field which lists the Base ID and it will be repeated as many times as there are parts in that BOM, then it goes to next Base ID and so on...
Each Part ID has a unique Piece Number field within each Base ID. I want to be able to identify the last Piece Number per Base_ID and add 10 to it, and that is the record I will append with a specific part number. (the same part number is to be added to the bottom of each BOM (Base Id grooup).
Is this possible?
Example of my table
BASE_ID PART_ID PIECE_NO
1234 xx1 10
1234 xx2 20
1234 xx3 30
1234 xx4 40
2345 yy1 10
2345 yy2 20
2345 yy2 30
So I want to identify that 40 is the last Piece_No for Base_Id 1234 and add 10 to it (to give me 50) and for Base_ID 2345, 30 is last Piece_no. I want to add 10 to get 40.... and make those the new Piece_No for new records with a new part zz1 to both these Base_IDs
Last edited: