Hey,
Im implementing changes to a medical database and have come accross a query problem.
I have one main table named Patient Info and from that I am wanting to report on anti biotic treatments with the 3 fields AntiBioticRegime (can be one of 5 drop down choices), AntibioticStartDate and AntibioticFinishDate.
On my reports page I have a user defined date range function which I call within each query.
The query Im trying to create is a count query to count the recurrences of AntiBioticRegime within the user defined date range. When I use the standard access select and count expressions it only counts each occurence of the differing dates and does not give me overall totals for each type of anti biotic regime. Below is the SQl in the query previously talked about...
SELECT PatientInfo.Antibioticregime, PatientInfo.AntibioticStartDate, PatientInfo.AntibioticFinishDate, Count(PatientInfo.Antibioticregime) AS [No]
FROM PatientInfo
GROUP BY PatientInfo.Antibioticregime, PatientInfo.AntibioticStartDate, PatientInfo.AntibioticFinishDate
HAVING (((PatientInfo.Antibioticregime)>"1") AND ((PatientInfo.AntibioticStartDate)>=[Forms]![Report Screen]![dateFrom] And (PatientInfo.AntibioticStartDate)<=[Forms]![Report Screen]![dateUntil]));
Any help on this would be extremely useful as I am stumped
Im implementing changes to a medical database and have come accross a query problem.
I have one main table named Patient Info and from that I am wanting to report on anti biotic treatments with the 3 fields AntiBioticRegime (can be one of 5 drop down choices), AntibioticStartDate and AntibioticFinishDate.
On my reports page I have a user defined date range function which I call within each query.
The query Im trying to create is a count query to count the recurrences of AntiBioticRegime within the user defined date range. When I use the standard access select and count expressions it only counts each occurence of the differing dates and does not give me overall totals for each type of anti biotic regime. Below is the SQl in the query previously talked about...
SELECT PatientInfo.Antibioticregime, PatientInfo.AntibioticStartDate, PatientInfo.AntibioticFinishDate, Count(PatientInfo.Antibioticregime) AS [No]
FROM PatientInfo
GROUP BY PatientInfo.Antibioticregime, PatientInfo.AntibioticStartDate, PatientInfo.AntibioticFinishDate
HAVING (((PatientInfo.Antibioticregime)>"1") AND ((PatientInfo.AntibioticStartDate)>=[Forms]![Report Screen]![dateFrom] And (PatientInfo.AntibioticStartDate)<=[Forms]![Report Screen]![dateUntil]));
Any help on this would be extremely useful as I am stumped