How do I add so it only do the calculation for max(OrderID) for each CustomerID and DeparmentNr?
Today it sometimes gets wrong beacuse if a order are changed the first are not removed, instead a new are created and I only want to sum the time for the latest order
Please let me now if I should give a better context.