I have two ms access 2003(.mdb) file one is student record the other is the test scores.
student record.mdb contents
tables:
basicinfo
schoolsattended
familyinfo
test scores.mdb contents
tables:
verbal
written
as you can see my student record.mdb has 3 table and the test score.mdb has 2, the important tables are only basicinfo, verbal and written dont mind the rest. what i want to do is count how many students got the specific scaled score using query for verbal and written as shown below.
[basicinfo](table1-student record.mdb)
[Name age rawscoreverbal rawscorewritten](fields)
mark 16 6 6
paul 17 5 5
bryan 16 8 8
jenny 16 7 7
verbal(table1-test scores.mdb)
[rawscore scaledscore](fields)
1 1
2 1
3 2
4 2
5 3
6 3
7 4
8 4
9 5
10 5
writen(table2-test scores.mdb)
[rawscore scaledscore]fields
1 1
2 1
3 2
4 2
5 3
6 3
7 4
8 4
9 5
10 5
expected output
Verbal:
Scaled Score Count
1 0
2 0
3 2
4 2
5 0
written:
Scaled Score Count
1 0
2 0
3 2
4 2
5 0
I’ve tried using this code
SELECT v.scaledscore as [Scaled Score], count(i.rawscore) as [Count]
FROM verbal v LEFT JOIN basicinfo i ON v.rawscore = i.rawscore
GROUP BY v.scaledscore
it works but only if all tables are together in one .mdb file. But i need two separate .mdb files since i have something else to do with it. I dont wanna explain it since its a very long story. Is it possible? if it is, can anyone help me?
In the MDB where you want to run the query, link to a table in the other MDB. If you make the link name the same as the table name, the query will find what it needs.
To link to an external table in Access 2003, from the main menu choose File->Get External Data->Link Tables. From there, the dialogs will guide you through selecting the database and then the table.
If Access 2007, find the Access icon above Import on the External Data section of the ribbon.