Derek Bob Angus ... Inv. No. Booked Charged Booked Charged Booked Charged _____ ______ _______ ______ _______ ______ _______ 1 0.75 0.75 2 6 5.5 12 11 3 20.5 20.5 ...So I need to sum the hours worked on a job, under each invoice ID, for each employee (JobAct.Hours), versus the hours required for each (JobHeads.Quantity)
Select JobAct.OurInvID, JobHeads.JobID, JobHeads.LabourID, ; SUM( jobheads.Quantity) as Booked, SUM( jobact.hours) as Charged, ; Labour.Text ; from jobheads ; Where jobheads.JobID = "RTvo" ; and not EMPTY( JobAct.OurInvID) ; INNER JOIN JobAct ; ON jobheads.JobID = jobact.JobID ; INNER JOIN Labour ; ON Jobheads.LabourID = Labour.ID ; group by JobAct.OurInvID, jobheads.JobID, JobHeads.LabourID ,Labour.Text ; order by JobAct.OurInvID, jobheads.JobID, JobHeads.LabourID ; into cursor JobsSA help would be much appreciated.