I have some data in a table in an MDB and I am building a query in MS Access. Seems simple but so am I 
I have a structure that is essentially always like this for all my records (A-F in this simplified sample):
SPU1 SPU2
A 1 NULL
B 1 NULL
C 1 2
D 1 2
E 2 NULL
F 2 NULL
I want to move the values in the E and F records like this:
SPU1 SPU2
A 1 NULL
B 1 NULL
C 1 2
D 1 2
E NULL 2
F NULL 2
The basic idea in my head is:
Step 1: Get all records where SPU2 IS NULL and GROUP BY SPU1
Step 2: Get all records where SPU2 IS NOT NULL and GROUP BY SPU2
Step 3: Take the list of unique SPU2s from Step 2. Get the first one, say, "SPU2=2," and look through the results from Step 1 and find where SPU1 = "SPU2=2"
Step 4: Move that SPU1 code from the SPU1 field to SPU2, and make SPU1 NULL
Step 5: Repeat Steps 3 and 4, working through the entire list from Step 2
Thanks in advance!
I have a structure that is essentially always like this for all my records (A-F in this simplified sample):
SPU1 SPU2
A 1 NULL
B 1 NULL
C 1 2
D 1 2
E 2 NULL
F 2 NULL
I want to move the values in the E and F records like this:
SPU1 SPU2
A 1 NULL
B 1 NULL
C 1 2
D 1 2
E NULL 2
F NULL 2
The basic idea in my head is:
Step 1: Get all records where SPU2 IS NULL and GROUP BY SPU1
Step 2: Get all records where SPU2 IS NOT NULL and GROUP BY SPU2
Step 3: Take the list of unique SPU2s from Step 2. Get the first one, say, "SPU2=2," and look through the results from Step 1 and find where SPU1 = "SPU2=2"
Step 4: Move that SPU1 code from the SPU1 field to SPU2, and make SPU1 NULL
Step 5: Repeat Steps 3 and 4, working through the entire list from Step 2
Thanks in advance!