Sum/Count on Aggregate Query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Toby Dann

    Sum/Count on Aggregate Query

    I have an aggregate query as recordsource for a form to show a list of
    invoices, including the totals (calculated by the aggregate query -
    I'm trying to duplicate as little info as possible here).

    What I want to achieve is a recordcount (of the number of records
    returned by the aggregate query) and Sum of the Invoice totals, but
    Access does not seem to like calculating either of these on an
    aggregate query.

    Any ideas? Am I going about this the wrong way entirely?

    TIA

    ToastEr
  • PC Datasheet

    #2
    Re: Sum/Count on Aggregate Query

    =DCount("*","Na meOfAggregateQu ery")

    The above will give you a recordcount.

    --
    PC Datasheet
    Your Resource For Help With Access, Excel And Word Applications
    resource@pcdata sheet.com



    "Toby Dann" <toastit@ntlwor ld.com> wrote in message
    news:fbf03c6d.0 404091538.54977 c63@posting.goo gle.com...[color=blue]
    > I have an aggregate query as recordsource for a form to show a list of
    > invoices, including the totals (calculated by the aggregate query -
    > I'm trying to duplicate as little info as possible here).
    >
    > What I want to achieve is a recordcount (of the number of records
    > returned by the aggregate query) and Sum of the Invoice totals, but
    > Access does not seem to like calculating either of these on an
    > aggregate query.
    >
    > Any ideas? Am I going about this the wrong way entirely?
    >
    > TIA
    >
    > ToastEr[/color]


    Comment

    • ToastEr

      #3
      Re: Sum/Count on Aggregate Query

      Hi and thanks for the reply,

      Unfortunately it's not that easy - I'm using a dynamically built SQL
      string as recordsource for the form in question to allow for various
      filters (view by client only, view unpaid only etc.) so there's no
      domain to specify.

      Any ideas?

      Also I found that if I remove my attempted sum of all invoices field, my
      Count([InvoiceID]) works fine (?) but not vice versa - and the Sum of
      all Invoices shown is more important.

      Thanks again.

      does vb cause hair-loss? (:)

      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      Working...