DSUM Missing Operator Help

Kitwolf

New member
Local time
Yesterday, 19:17
Joined
Jan 14, 2010
Messages
7
Hello,
I'm a newb here, so please bear with me (this is also my first attempt with Dsum). I've gone through all the posts and still I just can't seem to get my Dsum query to work without it giving me this:

Syntax error (missing operator) in Query section 'Seat_Code<=A1" . I figure I have a quotes missing or in the wrong place (?).

I just want a running sum of how many people (Att_Count) are at each table (Table) in my query (qryDining_Plan_Sun).

Attendee_ID, Last_Name, Table, Seat_Code, Att_Count, RunSum
1 - - - - - -Smith - - - A - - -A1 - - - -3 - - - -3
2 - - - - - -Thomas - -A - - -A2 - - - -1 - - - -4
4 - - - - - -Jones- - - A - - -A4 - - - -1 - - - -5
5 - - - - - -Moore- - - B - - -B5 - - - -1 - - - -1
6 - - - - - -Moore- - - B - - -B6 - - - -4 - - - -5
7 - - - - - -Moore - - -B - - -B7 - - - -2 - - - -7


Here is my code: DSum("[Att_Count]","[qryDining_Plan_Sun]","Seat Code<=" & [Seat Code] & "")​

I would appreciate anything you could help me with!!!​
 
Last edited:
Thanks for the swift response - much appreciated! I saw that post and tried to replicate it with the single quote before the double at the end (no space between the two, that's just to show in the post).
I also tried it before the [Seat Code] and same thing.

DSum("[Att_Count]","[qryDining_Plan_Sun]","Seat Code<=" & [Seat Code] & ' ")
Then I get the "Invalid string Error - String can only be 2048 characters long."
Sorry if I'm being dense.
 
You don't want the space, and you need double quotes before the single at the end. You're also missing the single quote at the beginning. Try:

DSum("[Att_Count]","[qryDining_Plan_Sun]","Seat Code<='" & [Seat Code] & "'")
 
Thanks. I tried that and same thing same error.
Here is the whole query:

SELECT qryDining_Plan_Sun.Attendee_ID, qryDining_Plan_Sun.Table, qryDining_Plan_Sun.Last_Name, qryDining_Plan_Sun.[Seat Code], qryDining_Plan_Sun.Att_Count, Sum(DSum("[Att_Count]","[qryDining_Plan_Sun]","Seat Code<='" & [Seat Code] & "'")) AS RunSum
FROM qryDining_Plan_Sun
GROUP BY qryDining_Plan_Sun.Attendee_ID, qryDining_Plan_Sun.Table, qryDining_Plan_Sun.Last_Name, qryDining_Plan_Sun.[Seat Code], qryDining_Plan_Sun.Att_Count;
 
The SeatCode field is text, right? Like the A1 in your first post? If so, the formula looks right. Try it without the Sum() and the entire GROUP BY clause. If that doesn't work, can you post the db?
 
Just a comment: Should not the field name TABLE be in brackets, as it is a reserved word?
 
Getting Closer!! That worked but it sums over all, I need it to run the sum over the group by Table.
Here is the dB:
 

Attachments

DSum("[Att_Count]","[qryDining_Plan_Sun]","Seat_Code<='" & [Seat_Code] & "' AND Table = '" &
& "'")
 
You are awesome, that did it!!!
Thank you so much for the assistance.
:D:D:D:D
 
No problemo, and welcome to the site by the way!
 

Users who are viewing this thread

Back
Top Bottom