Coursename,enddate1 and enddate2 are Request.QueryStrings form an .ASP web page which gnerates the query
The field is wish to SUM is "SERVICELEVEL"
I wish to COUNT the following
addressbook.ServiceLevel='Officer' +
addressbook.ServiceLevel='Senior Ranks' +
addressbook.ServiceLevel='Junior Ranks' = x
The critiria
Expand|Select|Wrap|Line Numbers
- SELECT *
- FROM Courselist INNER JOIN (addressbook INNER JOIN Applications ON addressbook.PersonID = Applications.PersonID) ON Courselist.CourseID = Applications.CourseID
- WHERE addressbook.Service='RN' AND AND(Applications.StatusCode='Passed' OR Applications.StatusCode='Failed') AND courselist.CourseTitle=coursename AND courselist.EndDate BETWEEN enddate1 AND enddate2