
Originally Posted by
ranman256
Give the date and only sum the hrs up to that date.
select [project], sum([hrs]) as HrsUsed where [date]<=#" & forms!frmMain!txtDate & "#"
Tried to include the project date but now the results show a line for every task rather than each project. SQL now looks like:
Code:
SELECT [TimeSpent Sum].SumOfTimeSpent, Client.ClientIdentifier, Client.Organisation, Service.ServiceType, Service.MonthlyRetainedHours, Project.ProjectStatus, Project.HoursAllocated, Project.Rate, Project.RateType, [AdditionalHours Sum].SumOfAdditionalHours, [hoursallocated]-[sumoftimespent]+[sumofadditionalhours] AS OverallRemaining, Project.ProjectStatus, Client.ClientStatus, Task.DateOfTaskFROM ((Client INNER JOIN Service ON (Client.ClientIdentifier=Service.ClientIdentifier) AND (Client.ClientIdentifier=Service.ClientIdentifier)) INNER JOIN ([AdditionalHours Sum] RIGHT JOIN ([TimeSpent Sum] INNER JOIN Project ON [TimeSpent Sum].Project_ProjectID=Project.ProjectID) ON [AdditionalHours Sum].Project_ProjectID=Project.ProjectID) ON (Service.ServiceID=Project.ServiceID) AND (Service.ServiceID=Project.ServiceID)) INNER JOIN Task ON (Task.ProjectID=Project.ProjectID) AND (Project.ProjectID=Task.ProjectID)
WHERE (((Service.ServiceType)="COMPLY As Required" Or (Service.ServiceType)="Comply Documentation") And ((Project.ProjectStatus)="Live Work") And ((Task.DateOfTask)<=Forms![COMPLY As Required Search]!StartDate));