DSUM function - Incorrect results

  • Thread starter Thread starter JoanDesm
  • Start date Start date
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?
 
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;
 
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?
 
Back
Top