dsum

  • Thread starter Thread starter ScottR3
  • Start date Start date
S

ScottR3

This is my first attempt at using dsum() in a query and I almost have it,
however, the running total is running in the wrong direction.

SELECT CustomerYTDSales.CUID, CustomerYTDSales.YTDSales,
DSum([YTDSales],"CustomerYTDSales") AS Expr1
FROM CustomerYTDSales
ORDER BY CustomerYTDSales.YTDSales DESC;

I have sorted YTDSales in descending order with the highest sales at the top
of the list. Dsum() in the above query is running from the bottom (lowest
sales) to the top. How can I reverse dsum to work from the top down?

By the way, I changed YTDSales to ASCENDING just to see if that would affect
how Dsum() worked. Dsum didn't change. It still totaled from the smallest
sales to the largest.

Scott
 
Oops, I double checked the running total and realized the running total
isn't working at all. The totals are much, much bigger than they should be.

Scott
 
DSUM("YTDSales","CustomerYTDSales","YtdSales>=" & YTDSales)

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
Thanks, John. That solved my problem.

Scott


John Spencer said:
DSUM("YTDSales","CustomerYTDSales","YtdSales>=" & YTDSales)

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

This is my first attempt at using dsum() in a query and I almost have it,
however, the running total is running in the wrong direction.

SELECT CustomerYTDSales.CUID, CustomerYTDSales.YTDSales,
DSum([YTDSales],"CustomerYTDSales") AS Expr1
FROM CustomerYTDSales
ORDER BY CustomerYTDSales.YTDSales DESC;

I have sorted YTDSales in descending order with the highest sales at the
top of the list. Dsum() in the above query is running from the bottom
(lowest sales) to the top. How can I reverse dsum to work from the top
down?

By the way, I changed YTDSales to ASCENDING just to see if that would
affect how Dsum() worked. Dsum didn't change. It still totaled from the
smallest sales to the largest.

Scott
 
Back
Top