UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Another running sum question    
 
   
Luceze
post Oct 27 2008, 04:30 PM
Post #1

UtterAccess VIP
Posts: 2,601
From: Dallas, Texas USA



Hi all,

I'm trying to create a DSUM running sum with multiple criteria. I can get single criteria to work but I'm having trouble adding additional criteria. Once I add the second piece it sums all of the data instead of grouping at any level.

Here is my SQL that doesnt work.
CODE
SELECT quPlan_Wages.lngSysID, quPlan_Wages.Amount, quPlan_Wages.lngYear, quPlan_Wages.lngMonth,
DSum("amount","quPlan_Wages","[lngMonth]<=" & [lngMonth] And "[lngSysID]=" & [lngSysID]) AS RunTot
FROM quPlan_Wages
GROUP BY quPlan_Wages.lngSysID, quPlan_Wages.Amount, quPlan_Wages.lngYear, quPlan_Wages.lngMonth;


Any suggestions?

Thanks,
Go to the top of the page
 
+
pbaldy
post Oct 27 2008, 04:36 PM
Post #2

UtterAccess VIP
Posts: 5,052
From: Nevada, USA



Try

DSum("amount","quPlan_Wages","[lngMonth]<=" & [lngMonth] & " And [lngSysID]=" & [lngSysID])
Go to the top of the page
 
+
Luceze
post Oct 27 2008, 04:40 PM
Post #3

UtterAccess VIP
Posts: 2,601
From: Dallas, Texas USA



Thank you Paul. (IMG:http://www.utteraccess.com/forum/style_emoticons/default/sad.gif) I didn't realize that the AND operator needed to be within the quotes.
Go to the top of the page
 
+
pbaldy
post Oct 27 2008, 04:42 PM
Post #4

UtterAccess VIP
Posts: 5,052
From: Nevada, USA



No problem. Basically the only things outside the quotes are those things being evaluated for their values (variables, form references, etc).
Go to the top of the page
 
+
Luceze
post Oct 27 2008, 04:51 PM
Post #5

UtterAccess VIP
Posts: 2,601
From: Dallas, Texas USA



Good to know.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 07:13 AM