Faster Alternative to DSumUpload ImagesLink John Walker 5 months ago
In the TechHelp video, "Check Register", Richard mentions that the method of using DSum in a query ("CheckRegQ") will slow down the dB operation where there are a large number of transactions. So, what is the alternative to DSum that doesn't slow down operation? Is a course offered that demonstrates that alternative?
Did you watch the video? It shows how to do a count without doing a DSUM
John Walker 5 months ago
I just now realized that Alex was giving me link to the Aggregate video. Sorry. At first I thought he had just given me a one-word response to my question. I have not yet viewed that video. But my understanding of aggregate queries is that they are not updateable, so I'm not sure this would work for something like a check register where wehn transactions are added the new running balance is shown immediately and in the same query.
Scott Axton 5 months ago
John how many transactions do you generate or anticipate generating?
You may be concerned about a minuscule amount of time difference.
Today's computers are pretty darn efficient. Unless you have a lot of users or are pulling huge amounts of data over a network that is pretty slow, I would run it as Richard showed and then worry about speed later.
John Walker 5 months ago
Thank you Scott. I will do that, but now I'm running into problems using dates in the criteria clause of the DSum function. I either get #Error or simply an empty field. I will write up the details of this problem in a new question tomorrow. I'm out of time today. Thanks again to each of you, Alex, Adam, and Scott for your responses.
Adam Schwanz 5 months ago
I can about guarantee your problem is null values. Try wrapping the DSUM (and the stuff it's adding up) in NZ Function
John Walker 4 months ago
Adam, it turns out that the problem with the errors in the DSum field was because I was trying to join two tables (one with transaction dates and one with the amounts) in the same query that used the DSum function. The solution was to use two queries ' one to join the tables and a second one that uses the first one as its data source and uses the DSum function.
Now I would like to put the first query into the second one as a subquery. However, when I do that, the DSum column displays #Error. So I guess I'm doing something wrong in trying to use a subquery AND a DSum function.
I tried to include the SQLs so you could see what I'm doing, but apparently there is a space limitation on these comments.
But any suggestions you (or anyone else) might have about using DSum in a query with a subquery would be most appreciated.
Adam Schwanz 4 months ago
Are you saying you were trying to use expressions created in the query inside of the DSUM? Otherwise I don't see how that would cause you an issue, if the text is too long you can always upload a picture too. Snip & Sketch
John, why don't you tell us what you're trying to do, and we'll figure out the most efficient way to do it for you. Explain it like you would to a 3rd grader. :)
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.