Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DSum expression w/query as Domain

Status
Not open for further replies.

hforman

Technical User
Nov 15, 2002
1
US
Help! I've been struggling with this expression for days! It's in an MS Access report:

=DSum("[Estimated Commissions]","Producer tracking query","[Status]='Closed Successfully'"AND"[Activity Type]='HAPR'")

When I reference the table as the domain, it works, but it gives me all the values in the table that meet the criteria. But I'm running this report from a query, I only want records in a certain date range, etc. When I reference the query (Producer tracking query) I get an #Error result.

Can you use a query as the domain in a DSum expression, and if so, how?
 
Hi!

I don't know if it is the problem or not, but you don't need the quotes around the And:

=DSum("[Estimated Commissions]","Producer tracking query","[Status]='Closed Successfully' AND [Activity Type]='HAPR'")


This should get you what you want.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top