I have a query i use to return some time lengths for test runs. The user inputs a start and end date and time for multiple test categories, the query will pull those results and use datediff to determine the length of the test.
The issue is that a single test run, ie id 1032, can include metrics for many things. In the attachment you will see that a, test 1032 having 7 metrics, St, Ha, Ha E, etc. What i need to do is distribute evenly the test length in to each of those metrics. As it stand now if i group on testid and sum the hours it looks like test 1032 took 45.5 hours where it actually took 6.5. If each line of the query held 1/7 of the total test time, ie .93 hours, this would total the correct length of 6.5.
Is there a way i can do this in the query
The issue is that a single test run, ie id 1032, can include metrics for many things. In the attachment you will see that a, test 1032 having 7 metrics, St, Ha, Ha E, etc. What i need to do is distribute evenly the test length in to each of those metrics. As it stand now if i group on testid and sum the hours it looks like test 1032 took 45.5 hours where it actually took 6.5. If each line of the query held 1/7 of the total test time, ie .93 hours, this would total the correct length of 6.5.
Is there a way i can do this in the query