DSUM with multiple criteria in same query

maabbas

Board Regular
Joined
Aug 11, 2011
Messages
201
Hello everyone,

I am trying to use the DSUM in query which look the value in another qry based on 3 criteria, somehow or maybe my lack of knowledge I am unable to get the result.

please see the following syntax

Code:
=DLookUp("[SumOfDT_Minutes]","[qry_sum_DT]","[qry_sum_DT].[DT_Date]=[qry_DPR].[P_Date] And [qry_sum_DT].[DT_Line_ID]=[qry_DPR].[P_Line] And [qry_sum_DT].[DT_Product]=[qry_DPR].[P_Code]")

any help will be greatly appreciated.

Thanks
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Possibly you can use DLookup in that third part of the DSum function. You can't just put another query in there by name as if it will run it or something.
 
Upvote 0
Possibly you can use DLookup in that third part of the DSum function. You can't just put another query in there by name as if it will run it or something.

my apologizes, I enter Dlookup in the code instead of Dsum. will you please explain how will i do that?

Thanks
 
Upvote 0
Well, you want some value from a query in your DSum() criteria, right? So DLookup does that kind of thing (maybe).
Example:
Code:
=DSum("[SumOfDT_Minutes]","[qry_sum_DT]","[qry_sum_DT].[DT_Date]=" & "#" & DLookup("P_Date","qry_DPR") & "#")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,777
Messages
6,161,871
Members
451,727
Latest member
tyedye4

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