Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DSum code not returning a value in query

Status
Not open for further replies.

RBE

Programmer
May 25, 2000
72
US
This is a query expression that is supposed to return a running sum over a group (destination terminal)of numbers (gallons received). Gallons received is a number and destination terminal is a text field. All of these are on the same table. It is comming back with a null value(blank), and I am not sure what is going wrong. Any suggestions???
RBE

DSum("[gallons received]","tenders table","[destination terminal]")
 
Can anyone tell me how to create a running total in a query. I have tried the MS suggestion and no matter how I do the dsum it will not work. It totals over the entire query and comes back with a single answer not a running total. You can always say tomarrow, but when you say yesterday, today is easier.

RBE

Our prayers go out to the WTC victims
 

The DSum function as posted is incomplete. Do you have some criteria for the aggregate? [Destination Terminal] is not a complete criteria. It should read something like [Destination Terminal] = 1 or [Destination Terminal] = 'NYC'.

Usually, I would not choose to use DSum in the query to obtain a running total. I would use the SQL SUM function in a correlated subquery. Perhaps you could post your query and I could make recommendations. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top