Query Results when Sum is included

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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).
 
Back
Top