Dsum fuction

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Puru pela
    New Member
    • Jan 2016
    • 7

    Dsum fuction

    How can I cause a query to open faster when I've used the dsum function to sum up sets of values
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    Change the query to use Sum() instead of DSum() if that makes sense. Asking such a question without including any information describing your problem doesn't

    Comment

    • Puru pela
      New Member
      • Jan 2016
      • 7

      #3
      The query runs perfectly well with the Dsum function but the only problem is that it takes long to open.

      Comment

      • mbizup
        New Member
        • Jun 2015
        • 80

        #4
        The Domain Aggregate functions (DSum, DLookup, etc) are notoriously slow when used in queries. As NeoPa suggested, you should use their SQL Aggregate counterparts in your queries (SUM, etc).

        If your sum needs no criteria other than those already in your query, you can add totals fields to your query very simply, as show in this tutorial:

        Totals queries

        If your sum needs additional criteria, you may need add a separate totals query and join to it, or write it out inline in your SQL as a sub query.

        There are plenty of excellent tutorials out there... just look for "Access Totals Query Tutorials" or similar using your preferred search engine.

        (We'd need to see your SQL to help with specifics)

        Comment

        • Puru pela
          New Member
          • Jan 2016
          • 7

          #5
          Thanks a lot for the contribution. I'll try to use subqueries and see if it solves my problem

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32633

            #6
            Originally posted by Puru Pela
            Puru Pela:
            The query runs perfectly well with the Dsum function but the only problem is that it takes long to open.
            It's fine that you know that, but unless you share details of your situation, the most obvious being the SQL of your query, then it's hard for us to know what we should offer you in the way of help. Please read How to ask "good" questions -- READ BEFORE SUBMITTING A QUESTION! where you will learn how to post a proper question, as well as why we ask you post them this way, just in case that isn't obvious. Remember, it isn't hard - It simply involves some preparation and consideration on your part before posting.

            Comment

            Working...