DSUM Function Parameters from Multiple Tables / Domains

bs0d

Well-known Member
Joined
Dec 29, 2006
Messages
622
I have this function to show a running total through time for a specific id:

Code:
Data_CUM: DSum("Sales","tblDailySales","[Item_KEY]=" & [Item_KEY] & " And [ReadingDate]<=#" & [ReadingDate] & "#")

How might I modify this to instead show the running total of a group of items that share a common group name from another table? Say the table was "tblItemProperties" and the desired field is "exampleGroup" ? (There would be an INNER JOIN on Item_KEY)

Finally, I'd also like to see how it would look if I needed to expand that more to those items that match an "exampleGroup" and "exampleSubGroup".

Thanks!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I'm reading here: DSum using criteria from multiple, related tables - Microsoft Community that you may be able to use dLookup in conjunction with DSUM to get what you're after. I'm trying some examples - no errors, but it doesn't seem to be producing the correct results. Here's what I have so far:
Code:
Data_CUM: DSum("Sales","tblDailySales","ReadingDate <=#" & [ReadingDate] & "# AND [Item_KEY]=" & DLookUp("[KEY_ID]","tblItemProperties","[exampleGroup] ='My_Group"))
 
Upvote 0
What I've decided to do is break it up into two queries:

1 - a make table query to have a running total by date per item.

2 - run a query on the new table that sum's the sums of items by date.
 
Upvote 0

Forum statistics

Threads
1,213,486
Messages
6,113,932
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top