|
DesiMcK -> RE: COUNT problem (5/12/2008 10:05:37)
|
I have now managed to do what I want - not elegent but it works. select pupilid, sum(iif (datepart('ww',incidentdate) = 1,1,0)) as wk1, sum(iif (datepart('ww',incidentdate) = 2,1,0)) as wk2, sum(iif (datepart('ww',incidentdate) = 3,1,0)) as wk3, sum(iif (datepart('ww',incidentdate) = 4,1,0)) as wk4, ...etc... Count(PupilID) as myTotal FROM tblBehaviour WHERE [Level] = 'Ac' GROUP BY pupilid Then I looped through the months in a table: <%for n = 1 to 52%> <td align="center"><%=FP_FieldVal(fp_rs,"wk" & n)%></td> <%next%> Thanks for your help. Desi
|
|
|
|