PDA

View Full Version : Solved: Dsum Error



evlai
05-08-2009, 01:45 AM
I am trying to create a running total query in my access, but getting the #Error when i run the query. Can I know how do I solve this?

DSum("[Rollout Quantity]","[F_Mapping FLP2]",
"[DtIdentifier]>=" & [DtIdentifier2]
& " And [PriIdentifier]>=" & [PriIdentifier2] & "")

:banghead: :banghead: :banghead:

OBP
05-08-2009, 03:11 AM
Unfortunately a running total query does not seem to be quite that simple, see the "difference" database that I posted here
http://www.vbaexpress.com/forum/showthread.php?t=26530

It also has a running sum version.

evlai
05-08-2009, 04:57 AM
Thank OBP - unfortunately I could not get the answer I want referring to your post...
See my result table in the file, I need the running total based on 2 criterias (chk 1 and chk2).can you pls help?: pray2: : pray2: : pray2:

OBP
05-08-2009, 06:28 AM
Chk 1 is not a value, did you mean ch2 and Roll out?

evlai
05-08-2009, 06:32 AM
I need the running total to calculate the sum of roll out
(based on chk 1 and chk 2) Not sure If I explained this correctly...Much chk 1 = value/ number?

OBP
05-08-2009, 06:35 AM
Do you mean like this?

evlai
05-09-2009, 03:23 AM
No.
I have converted chk2 to text instead so that it makes more sense :)

evlai
05-09-2009, 04:05 AM
:) I found the solution!! This is solved :hi:


SELECT T1.chk1, T1.chk2, T1.[Rollout Quantity], (SELECT Sum([table1].[Rollout Quantity]) AS Total
FROM [table1]
WHERE [table1].[chk1] = T1.[chk1] and [table1].[chk2] >= T1.[chk2]) AS CumRQ
FROM [table1] AS T1
ORDER BY T1.chk1 DESC , T1.chk2 DESC;

Cheers OBP :beerchug: