Hi
I have 2 tables from a workflow audit database joined in an optional one to many relationship. The resulting dataset from the query based on a date range returns:
Tbl-1 Tbl-2
Case1/StartDate/CancelledDate - PointCode1/Date1
Case1/StartDate/CancelledDate - PointCode2/Date2
Case1/StartDate/CancelledDate - PointCode3/Date3
Case1/StartDate/CancelledDate - PointCode4/Date4
Case1/StartDate/CancelledDate - PointCode5/Date5
....
Casen/StartDate/CancelledDate - PointCoden/Daten.
Records are grouped by another field in Tbl-1 (Service)
There may be zero, one or more records from Tbl-2 for each record in Tbl-1. Any one of the records in Tbl-2 may be either an intermediate audit point or a deliverable audit point. Deliverable Audit Point being considered the record of the workflow having been completed. (There may be other Audit points after this step but they don't count.)
I need to display the records in the dataset in the following manner.
Open Bal Received Completed Canc'd In Progress
Grp name: 1 3 1 1 2
OpenBalance can be calc by count where Startdate<=ParaStart and Tbl2.Daten >=ParaStart;
Received can be calc by count where StartDate in DateRange;
Completed can be calc by count where PointCode like "D*";
Canc'd can be calc by count where CancelledDate in DateRange;
My problem is that In progress (PointCodes not like "D*" could return zero, one or more records for the case and I only need to know that the case (Tbl-1) record is inprogress not count all the Audit Points.
I have tried conditional count and sum for the service footer and case footer.
I've even bastardised some of the suggestions found in this forum but to no avail.
Can someone offer a solution please?
I have 2 tables from a workflow audit database joined in an optional one to many relationship. The resulting dataset from the query based on a date range returns:
Tbl-1 Tbl-2
Case1/StartDate/CancelledDate - PointCode1/Date1
Case1/StartDate/CancelledDate - PointCode2/Date2
Case1/StartDate/CancelledDate - PointCode3/Date3
Case1/StartDate/CancelledDate - PointCode4/Date4
Case1/StartDate/CancelledDate - PointCode5/Date5
....
Casen/StartDate/CancelledDate - PointCoden/Daten.
Records are grouped by another field in Tbl-1 (Service)
There may be zero, one or more records from Tbl-2 for each record in Tbl-1. Any one of the records in Tbl-2 may be either an intermediate audit point or a deliverable audit point. Deliverable Audit Point being considered the record of the workflow having been completed. (There may be other Audit points after this step but they don't count.)
I need to display the records in the dataset in the following manner.
Open Bal Received Completed Canc'd In Progress
Grp name: 1 3 1 1 2
OpenBalance can be calc by count where Startdate<=ParaStart and Tbl2.Daten >=ParaStart;
Received can be calc by count where StartDate in DateRange;
Completed can be calc by count where PointCode like "D*";
Canc'd can be calc by count where CancelledDate in DateRange;
My problem is that In progress (PointCodes not like "D*" could return zero, one or more records for the case and I only need to know that the case (Tbl-1) record is inprogress not count all the Audit Points.
I have tried conditional count and sum for the service footer and case footer.
I've even bastardised some of the suggestions found in this forum but to no avail.
Can someone offer a solution please?