Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 903953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:58:21+00:00 2026-05-15T15:58:21+00:00

i have a query in access that is this: SELECT iif([Cup Type] like ‘*Cylinder*’,count([Cup

  • 0

i have a query in access that is this:

SELECT iif([Cup Type] like '*Cylinder*',count([Cup Type]),0) AS Cylinder, 
iif([Cup Type] like '*Snap*',count([Cup Type]),0) AS Snap, 
iif([Cup Type] like '*Tip*',count([Cup Type]),0) AS Tip, 
iif([Cup Type] like '*Other*',count([Cup Type]),0) AS Other
FROM [Lab Occurrence Form]
WHERE [1 0 Preanalytical (Before Testing)] Like '*1.3 QNS-Quantity Not Sufficient*' 
And ((([Lab Occurrence Form].[Occurrence Date]) 
Between Forms!Meeting_Reasons_Frequency!Text4 
And Forms!Meeting_Reasons_Frequency!Text2))
GROUP BY [Cup Type];

the output looks like this:

Cylinder    Snap    Tip Other
0   0   0   0
71  0   0   0
0   0   0   18
0   7   0   0
0   0   4   0

i apologize for the horrific formatting, but how do i get rid fo the zeros???

should i do something like select cylinder, snap, tip, other, from query1 where cylinder <> 0 etc..???

i want the output to be:

Cylinder    Snap    Tip Other
71  7   4   18
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:58:21+00:00Added an answer on May 15, 2026 at 3:58 pm

    After your clarification, what you would want, is switch the order of the count() and IIf() and change it to sum() so that you get

    sum(iif([Cup Type] like '*Cylinder*', 1, 0))

    etc.

    and then remove the group by in order to get one result row only.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query that originally looks like this: select c.Id, c.Name, c.CountryCode, c.CustomerNumber,
I have a Microsoft Access database query that I'm trying to import into a
I have a query in MS Access (2003) that makes use of a subquery.
I have a query in Data Access Object DAOComments that joins users table and
In access I wrote this query: Select I.sysid, I.MemberNumber, I.Date, I.Distributer, F.MemberNumber as FMember,
I have an access query which creates some output, 3 columns named e.g. A
I have a SQL query (MS Access) and I need to add two columns,
I have a ASP.Net page using ADO to query MS access database and as
In MS Access, I have a query where I want to use a column
I have an access database, with a query made. I need to automate it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.