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 ...

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.