How to output boolean to a query in in Access 2010

I have a table with boolean fields

[ItemID] as  text
[Qty] as number
[InStock] as boolean
[Call_Back] as boolean

How do I build a query to show how many times the Item is in stock and not in stock. I want to put these results 1 after the other in the query. Thanks
thao-nhiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
try this query

select itemid, sum(iif([instock]=-1,1,0)) as [In Stock] , sum(iif([instock]=0,1,0)) as [Not In Stock]
from tablex
group by itemid
0
thao-nhiAuthor Commented:
I  got an error message " Duplicate output alias as Order_Placed" when run the query as below

SELECT [PRODUCT INQUIRY].Part_ID, sum(iif([Order_Placed]=-1,1,0)) as [Order_Placed], sum(iif([Order_Placed]=0,1,0)) as [Order_Placed]
from [PRODUCT INQUIRY]
GROUP BY [PRODUCT INQUIRY].Part_ID;
0
thao-nhiAuthor Commented:
error message
Circular reference caused by alias Order_Placed in query definitions' select list


SELECT [PRODUCT INQUIRY].Part_ID, sum(iif([Order_Placed]=-1,1,0)) as [Order_Placed], sum(iif([Order_Placed]=0,1,0)) as [NO Order_Placed]
from [PRODUCT INQUIRY]
GROUP BY [PRODUCT INQUIRY].Part_ID;
0
Rey Obrero (Capricorn1)Commented:
Notice that in my query, the alias have a different name, [Order Placed] have no underscore


SELECT [PRODUCT INQUIRY].Part_ID, sum(iif([Order_Placed]=-1,1,0)) as [Order Placed], sum(iif([Order_Placed]=0,1,0)) as [NO Order_Placed]
 from [PRODUCT INQUIRY]
 GROUP BY [PRODUCT INQUIRY].Part_ID;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.