Hi all i have query which looks for patients under 18 and i would like them to be grouped between certain ages?
for eg.
ages howmany
0-4
5-10
11-18
the sql code i have got is this so far..
SELECT PATIENTS.Hospital_no, PATIENTS.firstname, PATIENTS.Surname, TREATMENT.TREATDATE, TREATMENT.AGE, TREATMENT.[NO TREATMENT GIVEN]
FROM PATIENTS INNER JOIN TREATMENT ON PATIENTS.Hospital_no = TREATMENT.HOSP_NO
GROUP BY PATIENTS.Hospital_no, PATIENTS.firstname, PATIENTS.Surname, TREATMENT.TREATDATE, TREATMENT.AGE, TREATMENT.[NO TREATMENT GIVEN]
HAVING (((TREATMENT.TREATDATE) Between #4/1/2004# And #4/1/2005#) AND ((TREATMENT.AGE)<18) AND ((TREATMENT.[NO TREATMENT GIVEN])=False))
ORDER BY TREATMENT.TREATDATE;
for eg.
ages howmany
0-4
5-10
11-18
the sql code i have got is this so far..
SELECT PATIENTS.Hospital_no, PATIENTS.firstname, PATIENTS.Surname, TREATMENT.TREATDATE, TREATMENT.AGE, TREATMENT.[NO TREATMENT GIVEN]
FROM PATIENTS INNER JOIN TREATMENT ON PATIENTS.Hospital_no = TREATMENT.HOSP_NO
GROUP BY PATIENTS.Hospital_no, PATIENTS.firstname, PATIENTS.Surname, TREATMENT.TREATDATE, TREATMENT.AGE, TREATMENT.[NO TREATMENT GIVEN]
HAVING (((TREATMENT.TREATDATE) Between #4/1/2004# And #4/1/2005#) AND ((TREATMENT.AGE)<18) AND ((TREATMENT.[NO TREATMENT GIVEN])=False))
ORDER BY TREATMENT.TREATDATE;