d***@gmail.com
2016-11-07 14:45:21 UTC
Hello and thanks in advance to any assistance.
I have a table called tblImportSN_Temp
This table consist of the following text fields.
* BatchNbr
* MfgCode
* SerialNbr
* Tech
* Logon
* Quadrant
I have an append query that imports a list of scanned serial numbers (from a csv file). This append query also populates the MfgCode, Tech, Logon, and Quadrant fields.
Typically there would be 1 to 6 serial numbers imported in for each scan.
An example of the tblImportSN_Temp could look something like this:
BatchNbr MfgCode SerialNbr Tech Logon Quadrant
X5235 12345678 JS jsmith A1
X5235 23456789 JS jsmith A1
X5235 34567890 JS jsmith A1
Z7654 AA786900 JS jsmith A1
Y9912 00001764 JS jsmith A1
ACS99 MN123098 JS jsmith A1
The next step and what I need assistance with is creating the Batch Number for each group of MfgCode.
Example of the tblImportSN_Temp after Batch Numbers have been assigned would look like this.
BatchNbr MfgCode SerialNbr Tech Logon Quadrant
161107001 X5235 12345678 JS jsmith A1
161107001 X5235 23456789 JS jsmith A1
161107001 X5235 34567890 JS jsmith A1
161107002 Z7654 AA786900 JS jsmith A1
161107003 Y9912 00001764 JS jsmith A1
161107004 ACS99 MN123098 JS jsmith A1
As you can see all the Serial Numbers that have a MfgCode of X5235 have the same batch number, and all the other Serial Numbers have different Batch Numbers because they all have different MfgCode.
I can create the Batch Numbers, I'm just not sure how to go about looping through the MfgCode to find any like codes and grouping them together to insure they get the same Batch Number.
Thanks again for any assistance!
I have a table called tblImportSN_Temp
This table consist of the following text fields.
* BatchNbr
* MfgCode
* SerialNbr
* Tech
* Logon
* Quadrant
I have an append query that imports a list of scanned serial numbers (from a csv file). This append query also populates the MfgCode, Tech, Logon, and Quadrant fields.
Typically there would be 1 to 6 serial numbers imported in for each scan.
An example of the tblImportSN_Temp could look something like this:
BatchNbr MfgCode SerialNbr Tech Logon Quadrant
X5235 12345678 JS jsmith A1
X5235 23456789 JS jsmith A1
X5235 34567890 JS jsmith A1
Z7654 AA786900 JS jsmith A1
Y9912 00001764 JS jsmith A1
ACS99 MN123098 JS jsmith A1
The next step and what I need assistance with is creating the Batch Number for each group of MfgCode.
Example of the tblImportSN_Temp after Batch Numbers have been assigned would look like this.
BatchNbr MfgCode SerialNbr Tech Logon Quadrant
161107001 X5235 12345678 JS jsmith A1
161107001 X5235 23456789 JS jsmith A1
161107001 X5235 34567890 JS jsmith A1
161107002 Z7654 AA786900 JS jsmith A1
161107003 Y9912 00001764 JS jsmith A1
161107004 ACS99 MN123098 JS jsmith A1
As you can see all the Serial Numbers that have a MfgCode of X5235 have the same batch number, and all the other Serial Numbers have different Batch Numbers because they all have different MfgCode.
I can create the Batch Numbers, I'm just not sure how to go about looping through the MfgCode to find any like codes and grouping them together to insure they get the same Batch Number.
Thanks again for any assistance!