DSUM function - Incorrect results

J

JoanDesm

I am trying to use a dsum function in a query

My table names are: Request, Count of Requests.

The first field in my query is: "Request"
My second field is: RequestsTotal:CountOfRequests
In the third field I built an expression:
DSum("[CountOFRequests]","RequestTable","[CountOFRequests]
=" & [RequestsTotal] & "")


The data in my table looks like this:

Request CountOfRequests
Type 1 75
Type 2 50
Type 3 38
Type 4 38

The running total after type 1 is 75
.....after type 2, 125
....after type 3, 163
......after type 4, 163.

If the number equals the previous number, then dsum
doesn't add it to the running total.

Any ideas?
 
J

JoanDesm

This is my SQL statement

SELECT QryRequest.RequestType, QryRequest.CountOfRequests
AS RequestTotal, DSum
("[CountOFRequests]","RequestTable","[CountOFRequests]>="
& [RequestsTotal] & "") AS CumSum
FROM QryRequest
ORDER BY QryRequest.CountOfRequests DESC;
 
D

david epsom dot com dot au

You've done that wrong haven't you :~)

You meant
,"[request] <= " & [request]

(david)

JoanDesm said:
I am trying to use a dsum function in a query

My table names are: Request, Count of Requests.

The first field in my query is: "Request"
My second field is: RequestsTotal:CountOfRequests
In the third field I built an expression:
DSum("[CountOFRequests]","RequestTable","[CountOFRequests]
=" & [RequestsTotal] & "")


The data in my table looks like this:

Request CountOfRequests
Type 1 75
Type 2 50
Type 3 38
Type 4 38

The running total after type 1 is 75
....after type 2, 125
...after type 3, 163
.....after type 4, 163.

If the number equals the previous number, then dsum
doesn't add it to the running total.

Any ideas?
 

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 1
dsum - 1
DSum Countrol Source Help 5
DSum() 1
DSum and date as criteria 3
DSUM QUESTION 1
dsum sytax error 5
DSum Acting Weird 2

Top