C
Chip
Hey everyone,
I've created a crosstab query. My Row heading is CourseName. My
Column Heading is County. I have 10 countes in which I'm interested
in. And 6 different courses. I am running a monthly report. Not all
courses run in each county each month. So in my Value field in my
Crosstab Query, I have it set to
Expr1: CLng(Nz(Avg([tblCourses]![StartDate]-[tblCourses]![Date
Approved]),0))
And I want the Average of these numbers so I'm using the AVG function
in the total. When I run the query, it catches the data I want and it
calculate the average. However, not al 10 counties are represented,
only those who have had courses conducted show. For example my result
is
CountyA CountyC
Course1
Course2
Course 1 may run in County A but not Course 2. So course 2 would show
a 0. Thats good and its what I want. However, CountyB does not have
any courses run. It just leaves CountyB out. I want CountyB to be
there...
Here is my SQL
PARAMETERS [Forms]![frmEOM]![StartDate] DateTime, [Forms]![frmEOM]!
[EndDate] DateTime;
TRANSFORM CLng(Nz(Avg([tblCourses]![StartDate]-[tblCourses]![Date
Approved]),0)) AS Expr1
SELECT COUNTIES.COUNTYNAME
FROM qryAvgNumDaysApptoStart, COUNTIES INNER JOIN (tblSites INNER JOIN
(tblCourseNum INNER JOIN tblCourses ON tblCourseNum.ID =
tblCourses.coursecode) ON tblSites.ID = tblCourses.TrainingSite) ON
COUNTIES.ID = tblSites.SiteCounty
WHERE (((tblCourses.[Date Approved]) Between [Forms]![frmEOM]!
[StartDate] And [Forms]![frmEOM]![EndDate]))
GROUP BY COUNTIES.COUNTYNAME
PIVOT tblCourseNum.coursename In ("EMS Instructor","Emergency First
Responder","Emergency Medical Technician","EMT Paramedic","Basic
Vehicle Rescue","Special Vehicle Rescue (89)","Basic Rescue
Practices","EMT-Bridge","Basic Vehicle Rescue (87)");
Question 1 - How do I get all of the counties to show.
Question 2 - I dont want my reader to confuse the default 0 in the Nz
statement to a 0 that is actually calculated.
Any help is great appreciated. And of course, if anyone woudl like
the 4 feet of show I have, I can send it to ya.. LOL
chip
I've created a crosstab query. My Row heading is CourseName. My
Column Heading is County. I have 10 countes in which I'm interested
in. And 6 different courses. I am running a monthly report. Not all
courses run in each county each month. So in my Value field in my
Crosstab Query, I have it set to
Expr1: CLng(Nz(Avg([tblCourses]![StartDate]-[tblCourses]![Date
Approved]),0))
And I want the Average of these numbers so I'm using the AVG function
in the total. When I run the query, it catches the data I want and it
calculate the average. However, not al 10 counties are represented,
only those who have had courses conducted show. For example my result
is
CountyA CountyC
Course1
Course2
Course 1 may run in County A but not Course 2. So course 2 would show
a 0. Thats good and its what I want. However, CountyB does not have
any courses run. It just leaves CountyB out. I want CountyB to be
there...
Here is my SQL
PARAMETERS [Forms]![frmEOM]![StartDate] DateTime, [Forms]![frmEOM]!
[EndDate] DateTime;
TRANSFORM CLng(Nz(Avg([tblCourses]![StartDate]-[tblCourses]![Date
Approved]),0)) AS Expr1
SELECT COUNTIES.COUNTYNAME
FROM qryAvgNumDaysApptoStart, COUNTIES INNER JOIN (tblSites INNER JOIN
(tblCourseNum INNER JOIN tblCourses ON tblCourseNum.ID =
tblCourses.coursecode) ON tblSites.ID = tblCourses.TrainingSite) ON
COUNTIES.ID = tblSites.SiteCounty
WHERE (((tblCourses.[Date Approved]) Between [Forms]![frmEOM]!
[StartDate] And [Forms]![frmEOM]![EndDate]))
GROUP BY COUNTIES.COUNTYNAME
PIVOT tblCourseNum.coursename In ("EMS Instructor","Emergency First
Responder","Emergency Medical Technician","EMT Paramedic","Basic
Vehicle Rescue","Special Vehicle Rescue (89)","Basic Rescue
Practices","EMT-Bridge","Basic Vehicle Rescue (87)");
Question 1 - How do I get all of the counties to show.
Question 2 - I dont want my reader to confuse the default 0 in the Nz
statement to a 0 that is actually calculated.
Any help is great appreciated. And of course, if anyone woudl like
the 4 feet of show I have, I can send it to ya.. LOL
chip