RE: running sum from a subform

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Sprinks (Sprinks_at_discussions.microsoft.com)
Date: 01/10/05


Date: Mon, 10 Jan 2005 06:07:04 -0800

Millisa,

Begin a new query, selecting the table or tables that contain the fields of
your expression. In the query design grid, in the Field row, enter a
calculated field, following the syntax:

     CalcalatedFieldName: expression

For example, to calculate the extended price of a line item,

    Extd: [Qty]*[UnitPrice]

Press the Exclamation Point to see the result, which will be a list of
[Qty]*[UnitPrice] for each line item in your table.

To sum this calculated field for ALL records in your database, switch to
Totals View (View, Totals). Change the default "Group By" in the Totals row
to Sum. Now click the Exclamation Point to see the result.

If you wish to calculate a total, grouping on some other field (such as
Order), drag that table's primary key (OrderNumber in this case) to the grid,
and keep the default "Group By" in the Total: row. This will now calculate a
separate total for each unique OrderNumber.

If, in addition, you have selection criteria, such as selecting records from
this year, drag the field to the grid, select WHERE in the Total: row, and
enter your criteria.

Hope that solves it.
Sprinks

"Millisa Eubanks" wrote:

> Nevermind the last post. I got it working agian but I'm not sure what went
> wrong or how I fixed it. Oh well. What I'm trying to do now is to figure
> out how to get a query to pull the values. I've tried my referance books but
> no dice. Could I please get some pointers



Relevant Pages

  • Re: Query Help for a beginner?
    ... If you can only use the query grid then ... -- Change Group By (in Totals) to Avg under Mileage and Price ...
    (microsoft.public.access.gettingstarted)
  • Re: Delphi7/ADO/SQL Server 2000 TDBGrid problem
    ... I use this approach to edit what I call simple system tables. ... is that I do not edit data in the grid. ... These can only be got rid of by selecting the ... I cannot just close the query and reopen it as I wish to retain the ...
    (borland.public.delphi.database.ado)
  • RE: running sum from a subform
    ... Thanks you for your help Sprinks. ... I was able to build a query that did the calcuations. ... > Order), drag that table's primary key to the grid, ... > If, in addition, you have selection criteria, such as selecting records from ...
    (microsoft.public.access.forms)
  • Re: Query calculation problem based on 1st and last operation.
    ... You may be able to do this with a simple Totals query. ... Access adds a Total row to the query design grid. ... In the Total row under these fields, ...
    (microsoft.public.access.queries)
  • Delphi7/ADO/SQL Server 2000 TDBGrid problem
    ... Depending on where grid is accessed from a different query is connected to ... indicator column as well. ... These can only be got rid of by selecting the row ...
    (borland.public.delphi.database.ado)