DCount Expression, 2 criteria on a report

Chief

Registered User.
Local time
Today, 10:50
Joined
Feb 22, 2012
Messages
156
Hello,
I have searched forum and google and tried a few suggestions, however I am not getting the correct results.

This is my Report (Preview View)
1641876409402.png

I am getting some figures which are correct but I think where I need to have 2 x criteria's I am not getting the results.
Some appear correct, others don't..

This is my query
1641876548495.png


SQL:
SELECT JobInfoT.JobID, JobInfoT.JobNumber, JobInfoT.JobTypeID, JobInfoT.SetOut_Detailer, JobInfoT.SetOutDue, JobInfoT.Cab_Base, JobInfoT.Cab_BaseDrawer, JobInfoT.Cab_Wall, JobInfoT.Cab_Tall, JobInfoT.Cab_Kick, JobInfoT.Cab_BHead, JobInfoT.SetOut_Complete, JobInfoT.SetOut_Date
FROM (EmployeeT RIGHT JOIN JobInfoT ON EmployeeT.EmployeeID = JobInfoT.SetOut_Detailer) LEFT JOIN JobTypesT ON JobInfoT.JobTypeID = JobTypesT.JobTypeID
WHERE (((JobInfoT.SetOut_Date) Between [Forms]![MainMenuF]![MainMenuSubform].[Form]![TxtStartDate] And [Forms]![MainMenuF]![MainMenuSubform].[Form]![TxtFinishDate]));

Each employee has done certain Job Types;
The expression I have been using is
Code:
=DCount("JobID","Ops_SetOut_BreakdownQ","JobTypeID = 10 and SetOut_Detailer = 7")
and I have tried
Code:
=DCount("[JobID]","Ops_SetOut_BreakdownQ","[JobTypeID] = 1 AND [SetOut_Detailer] = 7")

Each employee has completed a number of jobs
The expression I am using is (I think this is working)
Code:
=DCount("[JobID]","Ops_SetOut_BreakdownQ","[SetOut_Detailer] = 7")
and I have tried
Code:
=DCount("JobID","Ops_SetOut_BreakdownQ","SetOut_Detailer = 10 ")

To sum the types of cabinets,
I am using (Pretty sure this works)
Code:
=Nz(DSum("[Cab_Base]","Ops_SetOut_BreakdownQ"))
To Total all the cabinets
I am using (Pretty sure this works)
Code:
=Nz(DSum("[Cab_Base]+[Cab_BaseDrawer]+[Cab_Wall]+[Cab_Tall]+[Cab_Kick]+[Cab_BHead]","Ops_SetOut_BreakdownQ"))

Where Things are not adding up is under each detailer where the amount of the type of job.
e.g
Jobs = 10
But only showing PFB: 2, and all other types are 0

Thanks :)
 
if you run your Query and you manually compute it using the displayed records, do you get the correct result?
 

Users who are viewing this thread

Back
Top Bottom