Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Dynamic reporting from a crosstab query

$
0
0
Hi all,

I have a crosstab query for a complaints management database that summarizes the information on progress of a complaints by its severity.

Status list is
New
In Progress
Completed

Severity List
1 - Information only
2 - Minor Issue
3 - Major Issue
4 - Serious Issue

The query works fine on its own.
The report takes the parameters (Date Range) from a Form.
The reports works fine when there are all 4 severities recorded for the specified time period. The problem occurs when there are only two severities for the period.

I have checked on the report, the controls of each field is mapped correctly.

How can I get the query to either generate a 0 for the severity when none has been recorded for the specified period so that my report runs.
Or
A code for the Run Command button to populate 0 for the severity or status if they did not occur for the specified time period.
i.e. If for 1/10/2012 - 31/10/2012 no Sev. 3 or 4 were recorded, put a 0 in the field.

Help would be appreciated.

Crosstab query SQL:
PARAMETERS [Forms]![Summary Reports]![Text47] DateTime, [Forms]![Summary Reports]![Text49] DateTime;
TRANSFORM Count(infoTBL.ID) AS CountOfID
SELECT infoTBL.Status, Count(infoTBL.ID) AS [Total Of ID]
FROM infoTBL
WHERE (((infoTBL.[Date of Complaint]) Between [Forms]![Summary Reports]![Text47] And [Forms]![Summary Reports]![Text49]))
GROUP BY infoTBL.Status, infoTBL.[Date of Complaint], infoTBL.[Date of Complaint]
PIVOT infoTBL.Severity;

Database attached

Attached Files
File Type: zip Complaints Management System.zip (2.90 MB)

Viewing all articles
Browse latest Browse all 13329

Trending Articles