jeannier1975
New Member
- Joined
- Oct 31, 2018
- Messages
- 1
Good Day,
I have a query where i need to total the Labor hours
I have a field label ActualLabor hours and i want to take the total of that field of all the workorders and sum it.How would I go about it.
I have started the SQL Query
where for the time field TotalSeconds: (Sum(DatePart("h",[ActualLaborHours])*3600+DatePart("n",[ActualLaborHours])*60))
and the other field:
TotalTime: Round([TotalSeconds]/3600,0) & ':' & Right("00" & Round(((TotalSeconds/3600)-Round(TotalSeconds/3600,0))*60,0),2)
when i run the query i get an error stating [FONT="]This expression is typed incorectly or is too complexed to be evualated does anyone know how i can do a query that adds hours.
I have a query where i need to total the Labor hours
I have a field label ActualLabor hours and i want to take the total of that field of all the workorders and sum it.How would I go about it.
I have started the SQL Query
where for the time field TotalSeconds: (Sum(DatePart("h",[ActualLaborHours])*3600+DatePart("n",[ActualLaborHours])*60))
and the other field:
TotalTime: Round([TotalSeconds]/3600,0) & ':' & Right("00" & Round(((TotalSeconds/3600)-Round(TotalSeconds/3600,0))*60,0),2)
when i run the query i get an error stating [FONT="]This expression is typed incorectly or is too complexed to be evualated does anyone know how i can do a query that adds hours.
Code:
[/FONT][/COLOR]SELECT (Sum(DatePart("h",[ActualLaborHours])*3600+DatePart("n",[ActualLaborHours])*60)) AS TotalSeconds, Round([TotalSeconds]/3600,0) & ':' & Right("00" & Round(((TotalSeconds/3600)-Round(TotalSeconds/3600,0))*60,0),2) AS TotalTimeFROM [Maximo Report]
WHERE ((([Maximo Report].WorkType)="CM" Or ([Maximo Report].WorkType)="EM" Or ([Maximo Report].WorkType)="MMNRO" Or ([Maximo Report].WorkType)="MMROI" Or ([Maximo Report].WorkType)="PMCM" Or ([Maximo Report].WorkType)="PMINS" Or ([Maximo Report].WorkType)="PMOR" Or ([Maximo Report].WorkType)="PMPDM" Or ([Maximo Report].WorkType)="PMREG" Or ([Maximo Report].WorkType)="PMRT") AND (([Maximo Report].ActualStartDate)>=DateAdd("h",-1,[Enter the Start Date]) And ([Maximo Report].ActualStartDate)<DateAdd("h",23,[Enter the End Date])));
[COLOR=#333333][FONT="]/CODE][/FONT][/COLOR]