I have a situation where I'd like to look up a query that has a date field, along with an estimated hours field. This query may represent 20-100 records. I'd like to sum them up the estimated hours by date, then loop through the sums in a recordset. If the sum for a given day exceeds X, I want to send an email notifying someone of the conflict.
I'm having a hard time wrapping my head around the most efficient way to do get the sums. If it helps, below is the SQL for the base query.
I'll try to attach the results. When I try to sum up the EstHrs field per day, it seems to pull in results that should be filtered out by the "WorkOrdStatusNbr>5"
Thanks for any insight.
I'm having a hard time wrapping my head around the most efficient way to do get the sums. If it helps, below is the SQL for the base query.
Code:
SELECT DBA_WO.TargetFinDt, DBA_WO.EstHrs
FROM DBA_WO
WHERE (((DBA_WO.TargetFinDt)>Date()) AND ((DBA_WO.WorkOrdStatusNbr)<5))
ORDER BY DBA_WO.TargetFinDt;
I'll try to attach the results. When I try to sum up the EstHrs field per day, it seems to pull in results that should be filtered out by the "WorkOrdStatusNbr>5"
Thanks for any insight.