[AccessD] DSUM Function - HELP

A.D.Tejpal adtp at touchtelindia.net
Fri May 13 23:34:21 CDT 2005


Kaup,

    You should be able to get some working ideas from my sample db named RunningCountSum_2K. It is available at Rogers Access Library (other developers library). Link -
http://www.rogersaccesslibrary.com

    Typically, running computations (Count and Sum) in a query involves use of either a subquery or DCount function. Both require (i) A primary key  and  (ii) Sorting to be in force - on the primary key field. This can pose a limitation where main sorting is desired on a field other than that holding primary key. Moreover if subquery method is used, the records are no longer editable. 
(The sample db is free from such limitations).

Best wishes,
A.D.Tejpal
--------------

  ----- Original Message ----- 
  From: Kaup, Chester 
  To: accessd at databaseadvisors.com 
  Sent: Saturday, May 14, 2005 01:48
  Subject: [AccessD] DSUM Function - HELP


  I am trying to use the DSUM function in the following query to get a running total of the field1 field. All I get is the total of the field column on each line of the DSUM. What am I doing wrong or is this the wrong function? 

  SELECT Table1.Date1, Table1.Field1, DSum("Field1","Table1") AS [Running
  Total]

  FROM Table1

  GROUP BY Table1.Date1, Table1.Field1

  ORDER BY Table1.Date1; 

  Data

  Table1

  Date1

  Field1

  1/1/2204

  10

  2/1/2004

  5

  3/1/2004

  7

  4/1/2004

  8

  5/1/2004

  14

  6/1/2004

  6




More information about the AccessD mailing list