Criteria not found in query, need to report "0"

Rasberry

Board Regular
Joined
Aug 11, 2002
Messages
201
Office Version
  1. 365
I have a query which is summing the market value for different asset classes in a portfolio. If the asset class is not there (i.e. the portfolio does not have any municipals, for example), instead of returning zero for the sum, it just leaves off municipals in the row. I would like it to list "municipals" and put zero in for the sum. Not sure how to do that.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Often this is accomplished with a LEFT JOIN rather than a JOIN. But it's hard to say without seeing your query.
 
Upvote 0
Yes, you will probably need to do what xenou said in order to return those municipals without matches.
In order to physically show a zero, you probably will also need to use the NZ function, which tells Access what to return in the even of a null (otherwise, it will just return null values for those unmatched municipals).

For example:

MyAmount:NZ([AmountField1],0)+0

The "+0" is just there to coerce the formula to return a value (by default, the NZ function returns a string).
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

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