Query Results when Sum is included

L

Lloyd

My app has tblGrantProgram with a one to many relationship with tblGrants. I
am trying to create a query which yields one record for each grant program
and the total grant amount awarded (sum of the GrantAmount field in
tblGrants) for each grant program.

Simply adding SumofGrantAmounts to the query works for all programs that
have a grant record associated with them. But programs with no grants and
therefore grant amounts linked to them are dropped from the results.

Can someone help me to get all of the programs to display along with the sum?

Thanks, Lloyd
 
S

Steve Schapel

Lloyd,

You need to use a Left Join in your query, instead of the default Inner
Join. If you open the query in design view, right-click on the join
line between the tables, and select Join Properties, you can then choose
the option that says something along the lines of "all records from
tblGrantProgram and only matching records from tblGrants).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top