hi to all
Im having trouble writing some code, and I'm hoping to get some advice. Here's the situaltion...
I have tblP and tblQ.
In tblP, each PID holds 6 records having PRow from 1 to 6. The PVal will always have three 1s and three 0s, in varying orders.
In tblQ, each QID holds 3 records having QRow from 1 to 3. The QVal will be three different integers.
I need to INSERT the QVal numbers into the Result column of tblP WHERE PID = QID, and PVal = 0.
The order of inserting the QVal numbers is important - the same order must be kept.
The desired outut would look like...
Thanks in advance for any hints!
Im having trouble writing some code, and I'm hoping to get some advice. Here's the situaltion...
I have tblP and tblQ.
In tblP, each PID holds 6 records having PRow from 1 to 6. The PVal will always have three 1s and three 0s, in varying orders.
In tblQ, each QID holds 3 records having QRow from 1 to 3. The QVal will be three different integers.
Code:
tblP tblQ
PID PRow PVal Result QID QRow QVal
========================== ================
1 1 1 1 1 8
1 2 0 1 2 60
1 3 0 1 3 -7
1 4 1
1 5 0 2 1 12
1 6 1 2 2 -4
2 3 99
2 1 0
2 2 1 ... etc
2 3 0
2 4 1
2 5 1
2 6 0
... etc
I need to INSERT the QVal numbers into the Result column of tblP WHERE PID = QID, and PVal = 0.
The order of inserting the QVal numbers is important - the same order must be kept.
The desired outut would look like...
Code:
tblP
PID PRow PVal Result
==========================
1 1 1
1 2 0 8
1 3 0 60
1 4 1
1 5 0 -7
1 6 1
2 1 0 12
2 2 1
2 3 0 -4
2 4 1
2 5 1
2 6 0 99
... etc
Thanks in advance for any hints!