hi to all,
I have a table (tblMatchValues) with 120 rows like this:
ID A B C D E F
1 0 0 1 0 -3 -5
2 1 0 3 0 -1 0
3 ...etc
After each ID, there are 6 integers. Three are always 0 (representing teams playing at home), and each the other three (representing teams on the road) are 'paired' with a 0 as follows:
In the first row, 'A=0' pairs with 'F=-5' because 'F' moves 5 to the left to play 'A'. Similarly, 'B= 0' matches with 'E=-3', and 'D=0' matches with 'C=+1'. Each row follows this pattern.
I need to populate another table (tblMatchSQL) like this:
ID strSQL
1 "(A=0 AND F=-5) OR (B=0 AND E=-3) OR (D=0 AND C=1)"
2 "(B=0 AND A= 1) OR (D=0 AND E=-1) OR (F=0 AND C=3)"
3 ... etc
I've learned a lot from this forum, but coding this is still a little beyond my reach. I'd appreciate any help.
Thank you, Vicky
I have a table (tblMatchValues) with 120 rows like this:
ID A B C D E F
1 0 0 1 0 -3 -5
2 1 0 3 0 -1 0
3 ...etc
After each ID, there are 6 integers. Three are always 0 (representing teams playing at home), and each the other three (representing teams on the road) are 'paired' with a 0 as follows:
In the first row, 'A=0' pairs with 'F=-5' because 'F' moves 5 to the left to play 'A'. Similarly, 'B= 0' matches with 'E=-3', and 'D=0' matches with 'C=+1'. Each row follows this pattern.
I need to populate another table (tblMatchSQL) like this:
ID strSQL
1 "(A=0 AND F=-5) OR (B=0 AND E=-3) OR (D=0 AND C=1)"
2 "(B=0 AND A= 1) OR (D=0 AND E=-1) OR (F=0 AND C=3)"
3 ... etc
I've learned a lot from this forum, but coding this is still a little beyond my reach. I'd appreciate any help.
Thank you, Vicky