I know that all of the domain aggregate functions are slow, but I am looking for the least of the evils.
Which will be the faster of the following two options?
- Create a query that will group by the unique value and sum the total. Have dlookup to get my sum from the query.
- Do a dsum on the main table with the criteria being the same as my
GROUP BY
columns in option 1?
Edit 1
My question is a generic question that I have wondered in many situations but below is a specific situation under consideration right now.
On my time entry detail subform I need to show how much materials have been used on this job. The control source for the textbox looks like this:
=DLookUp("[SumOfPrice]","tm_materialsUsedByPart","[Part]=" & [cmbPart])
tm_materialsUsedByPart
is currently a query that is summing up all the materials used.
Would it be faster to use a dsum that have esentially the same criteria or is it faster to execute the query then grab the single row that matches my criteria?