Hi ,
is this correct query for access database..

string findrecord = "SELECT  s.test_no, COUNT(s.test_no) AS totalQ,(SELECT        COUNT(s.que_id) AS CorrectS FROM            Testmark AS t INNER JOIN   StartTest AS s ON s.test_no = t.test_no AND s.que_id = t.que_id AND t.ans = s.ans  and t.test_no = '" + GlobalMember.TestNumber + "') AS CorrectS, (SELECT        stud_id FROM            Registration_master) AS stud_id FROM            Test_Detail AS s INNER JOIN   Testmark AS t ON s.test_no = t.test_no WHERE        (s.test_no = '" + GlobalMember.TestNumber + "')GROUP BY s.test_no";

Error is syntax error in select stt. i.e after count

Can anybody help me ...

Recommended Answers

Are you attempting to do a SubQuery in Access or are you wanting to join two tables?

http://www.ehow.com/how_6955614_do-subselect-query-access.html

Jump to Post

All 3 Replies

Both subquery and inner join it works in sql server db how abt access.

Does the student ID in Registration_master not need a where clause?
What I'm asking is: How are you keeping track of a student to a test?
The other tables either don't have student IDs or the Registration_master does not have test_ids.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.