dsum

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
 
S

ScottR3

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
 
J

John Spencer

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
'====================================================
 
S

ScottR3

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

dsum sytax error 5
DSUM error# Syntax problem? 4
Dsum slow 2
DSUM question 3
Help with DSum to create running sum 11
DSUM Help requested. 0
Running Sum Error in Query 7
Advance question: Need to "cluster" records 3

Top