DSUM Syntax with multiple Criteria (1 Viewer)

hvaugh00

New member
Local time
Today, 08:45
Joined
Jun 12, 2019
Messages
3
Hi – I’m really struggling to get this DSum formula to work and I’m hoping someone can help. I would be so grateful!

What I’m attempting to do is sum the Actual Alloc to Total Division based on the combination of fields COMBO and MBU and whether Mcdonald’s is included.

Table 1 (0014a update actual SMA expenses table)
-Contains Actual Allocations to Total Division
-Combo
-Include McDonalds

Table 2 (0014 AFE PA Data w/ Data Combos Table)
-MBU
-Include McD

Where Combo = MBU and Include McDonald’s = Include McD, I want to return the sum of the Actual Alloc to Total Division. The formula I came up with is returning the complete total for Actual Alloc to Total Division regardless of the 2 criteria.

My formula:
MBU test: DSum("[Actual Alloc to Total Division]","0014a update actual SMA expenses table","COMBO='" & [0014 AFE PA DATA w/ Data Combos table]![MBU] & "'" And "Include McDonalds='" & [0014 AFE PA DATA w/ Data Combos table]![Include Mcd] & "'")

Thanks in advance!!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:45
Joined
Oct 29, 2018
Messages
21,357
Hi. Welcome to the forum. Are you entering this expression in a query? If so, can you show us the whole query? Thanks.
 

hvaugh00

New member
Local time
Today, 08:45
Joined
Jun 12, 2019
Messages
3
Hi! Thanks for replying. Attached is a screenshot from my query.
 

Attachments

  • qry.PNG
    qry.PNG
    56.7 KB · Views: 377

theDBguy

I’m here to help
Staff member
Local time
Today, 06:45
Joined
Oct 29, 2018
Messages
21,357
Hi! Thanks for replying. Attached is a screenshot from my query.
What do you get if you simply connect those two fields as well and not use DSum()? If you add those two connections/links, you can try using Sum instead of Group By.
 

hvaugh00

New member
Local time
Today, 08:45
Joined
Jun 12, 2019
Messages
3
Thank you! That worked. The issue is that I have 9 other Combos (besides MBU) that I'm going to have to create different queries for and then append all together since I can't get the Dsum syntax right :banghead:
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:45
Joined
Oct 29, 2018
Messages
21,357
Thank you! That worked. The issue is that I have 9 other Combos (besides MBU) that I'm going to have to create different queries for and then append all together since I can't get the Dsum syntax right :banghead:
Hi. If we knew more about your database, we might be able to offer a better solution. Unfortunately, you're the only one who knows more about it at this time.
 

Users who are viewing this thread

Top Bottom