sql - Running total for period. Dsum & correlated subquery too slow -


The following is my DSum () function. To run the final report and 9 times out of 10 Accidents Databases takes a lot of time.

qryActualSums -> Different queries that calculate total labor hours for a duration (1-12) & . Job number

The DSum () function is to calculate the total number of jobs running in a given period. For example if this period is 6, the total area duration will be 5, 4, 3, 2, 1. All the zodiacs will be

  Labor hours. DSUM ("LabHours", "qryActualSums", "JOBNUM =" & [JOBNUM] & amp; "and qryActualSums.Period & lt; =" & [qryActualSums.Period])  

Here is the correlated subquery result came along. It runs slower than DSUM ()

  YTD Labor time: (sum (select SumOfLABHOURS) from qryActualSums a1 where JOBNUM = qryActualSums.JOBNUM and duration & lt; = qryActualSums.Period ) <. / Code> 

In both ways, I write the result query itself as field expression.

Any alternative method, suggestions, comments, suggestions, tricks, whatever?


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -