Hey I'm sorry to bother you guys again. Made a few adjustments to the totals and having a small issue, wondering if anyone knows a workaround. Here is the SQL I have in there now.
Code:
SELECT DDRs_Table.PWC,
Count(DDRs_Table.PWC) AS [NO DDRS LOADED],
Sum(IIf([DDRs_Table]![ERROR TYPE].[Value],1,Null)) AS [TOTAL NO ERRORS],
Sum(IIf([DDRs_Table]![ERROR TYPE]![VALUE]="AT",1,Null)) AS AT,
Sum(IIf([DDRs_Table]![ERROR TYPE]![VALUE]="CA",1,Null)) AS CA,
Sum(IIf([DDRs_Table]![ERROR TYPE]![VALUE]="HMAL",1,Null)) AS HMAL,
Sum(IIf([DDRs_Table]![ERROR TYPE]![VALUE]="OTHER",1,Null)) AS OTHER,
Sum(IIf([DDRs_Table]![ERROR TYPE]![VALUE]="TM",1,Null)) AS TM,
Sum(IIf([DDRs_Table]![ERROR TYPE]![VALUE]="WUC",1,Null)) AS WUC,
Sum(IIf([DDRs_Table]![DDRSTATUS]="ERROR NOT CORRECTABLE",1,Null)) AS [NO UNCORRECTABLE ERRORS],
Sum(IIf([DDRs_Table]![DDRSTATUS]="NOT REVIEWED",1,Null)) AS [NOT REVIEWED]
FROM DDRs_Table
WHERE (((DDRs_Table.PWC)="AG130"
Or (DDRs_Table.PWC)="AGCNS"
Or (DDRs_Table.PWC)="AGCTK"
Or (DDRs_Table.PWC)="AGDBF"
Or (DDRs_Table.PWC)="AGELE"
Or (DDRs_Table.PWC)="AGENG"
Or (DDRs_Table.PWC)="AGFLT"
Or (DDRs_Table.PWC)="AGGCS"
Or (DDRs_Table.PWC)="AGPNE"
Or (DDRs_Table.PWC)="AGWPN")
AND ((DDRs_Table.RANGESTOP) Like "*" & [Enter RANGESTOP] & "*"))
GROUP BY DDRs_Table.PWC;
My issue is the TOTAL NO ERRORS field in the query causes the NO DDR LOADED and NO UNCORRECTABLE ERRORS field to increase because of a multivalued field, this only happens when using the Sum(IIf function like in the code above. However when I go back to using the Count( function like in the code below for the TOTAL NO ERRORS the multivalued field does not affect the other totals.
Code:
TOTAL NO ERRORS: Count([DDRs_Table]![ERROR TYPE])
Below I have uploaded a screenshot of the multivalued field and then the results of the query using Count( followed by using sum(IIf.
In this example for AGCNS there are 11 total jobs, 1 job has an AT error that was correctable, 1 job has a HMAL and WUC error one or both of which was uncorrectable, however we only count entire jobs as uncorrectable not all the errors in that job. Therefore there should be only one uncorrectable error.
Is there an expression I could use to prevent the two fields highlighted in yellow below from increasing to account for the extra check in the mulitvalued field.
I tried to upload my back end database but unfortunately it is to big. If it would help I can try to email a copy of the back end to anyone willing to help.
Thanks