fn27
fn27

Reputation: 879

MS access - count function

I am trying to count number of rows in my complex query (this query is designed to meet my requirement). The result should be, e.g. NumberOfRecord: 10. However, I am not getting the result I am expecting. How do I improve my query? Thanks

My query:

enter image description here>

Result:

http://img815.imageshack.us/img815/6414/222222o.png

The MS Access SQL view:

SELECT Count(tblMeeting.Meeting_Id) AS [Number of jobs]
FROM (tblEmployee INNER JOIN tblMeetingType ON tblEmployee.Emp_Id = tblMeetingType.Chairperson_Id) INNER JOIN tblMeeting ON tblMeetingType.Type_Id = tblMeeting.Type_Id
GROUP BY tblMeeting.MeetingDate, tblMeeting.AgendaApproved, tblMeeting.AgendaTopic
HAVING (((tblMeeting.MeetingDate)>DateAdd("d",3,Now())) AND ((tblMeeting.AgendaApproved)=False) AND ((tblMeeting.AgendaTopic) Is Not Null));

Upvotes: 0

Views: 3160

Answers (1)

fn27
fn27

Reputation: 879

Thanks guys, I finally solved my problem.

I have changed GROUP BY to WHERE.

The query should look like this:

http://img715.imageshack.us/img715/628/solutionl.png

Upvotes: 1

Related Questions