Hi Richard, In your example of dealing with returned errors by using iif(isnull, can this method also be used in the group by catagory to name the null grouping to something like "# of customers without contacts", this would only be when counting contacts by customer. When I try it for my example I get a error "The specified field [Shoplist] could refer to more than one table listed in the FROM clause of your SQL statement. Below is my SQL
SELECT IIf(IsNull([ShopList]),"No Shop Assigned",[ShopList]) AS ShopCountList, Count(EmployeeCombinedQ.EmployeeID) AS CountOfEmployeeID FROM EmployeeCombinedQ LEFT JOIN ShopListT ON EmployeeCombinedQ.ShopListID = ShopListT.ShopListID GROUP BY IIf(IsNull([ShopList]),"No Shop Assigned",[ShopList]);
Reply from Alex Hedley:
Does [ShopList] appear in both the Table and the Query that you're joining?
Try adding either ShopListT.[ShopList] or EmployeeCombinedQ.[ShopList]
Access doesn't know which one you are referring to.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Expert 11.