Y
Yobbo
Hi All
Wondered if you could help.
I have 2 tables of data like so:
PUPILS
PID PNAME
1 Fred1
2 Fred2
3 Fred3
4 Fred4
LEVELS
TID PID YEAR TERMID MATHSLEVEL READLEVEL
1 1 2006 0 W1 W2
2 2 2006 0 1B W4
3 3 2006 0 W1 W2
4 4 2006 0 2C 5A
5 1 2007 1 W1 W2
6 2 2007 1 1B W4
7 3 2007 1 W1 W2
8 4 2007 1 2C 5A
9 1 2007 2 W1 W2
10 2 2007 2 1B W4
11 3 2007 2 W1 W2
12 4 2007 2 2C 5A
13 1 2007 3 W1 W2
14 2 2007 3 1B W4
15 3 2007 3 W1 W2
16 4 2007 3 2C 5A
I link the 2 tables simply by joining the PIDs.
What I need to do is get 1 recordset of data that includes all rows with a
TERMID=0 and YEAR=2006 *and* a TERMID=1 and YEAR=2007 *and* a TERMID=2 and
YEAR=2007 *and* a TERMID=3 and YEAR=2007.
I can get the data quite easily if I do the above as 4 seperate queries, but
I need all of the rows relevant to these 4 permitations in 1 recordset.
I tried putting each permitation in brackets, but Access either didn't
like the brackets or brought back hundreds of duplicate rows.
Any ideas?
Wondered if you could help.
I have 2 tables of data like so:
PUPILS
PID PNAME
1 Fred1
2 Fred2
3 Fred3
4 Fred4
LEVELS
TID PID YEAR TERMID MATHSLEVEL READLEVEL
1 1 2006 0 W1 W2
2 2 2006 0 1B W4
3 3 2006 0 W1 W2
4 4 2006 0 2C 5A
5 1 2007 1 W1 W2
6 2 2007 1 1B W4
7 3 2007 1 W1 W2
8 4 2007 1 2C 5A
9 1 2007 2 W1 W2
10 2 2007 2 1B W4
11 3 2007 2 W1 W2
12 4 2007 2 2C 5A
13 1 2007 3 W1 W2
14 2 2007 3 1B W4
15 3 2007 3 W1 W2
16 4 2007 3 2C 5A
I link the 2 tables simply by joining the PIDs.
What I need to do is get 1 recordset of data that includes all rows with a
TERMID=0 and YEAR=2006 *and* a TERMID=1 and YEAR=2007 *and* a TERMID=2 and
YEAR=2007 *and* a TERMID=3 and YEAR=2007.
I can get the data quite easily if I do the above as 4 seperate queries, but
I need all of the rows relevant to these 4 permitations in 1 recordset.
I tried putting each permitation in brackets, but Access either didn't
like the brackets or brought back hundreds of duplicate rows.
Any ideas?