Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MsAccess bug? or query wrong?

Posted on 2006-06-14
3
Medium Priority
?
205 Views
Last Modified: 2010-08-05
Performing a query, I need a sum of counts of tables.

Query:
SELECT DISTINCT (      SELECT COUNT ([CSTLINKMEMBERS1])
                                    FROM CSTLINKMEMBERSCHECKED
                                    WHERE ((CSTLINKMEMBERS1)=0)
      )
      AS PASSED1
FROM CSTLINKMEMBERSCHECKED;

The subquery DOES return "0":  SELECT COUNT ([CSTLINKMEMBERS1])  FROM CSTLINKMEMBERSCHECKED WHERE ((CSTLINKMEMBERS1)=0).
I would expect this to return "0", would you not?
However it returns no rows at all! its frustrating!

Note: there are times I need to test over 18 fields, so the following query will not work, because of the annoying "Query is too Complex" (one table per field).
SELECT COUNT ([a.CSTLINKMEMBERS1]) AS PASSED1,
FROM
(SELECT CSTLINKMEMBERS1 FROM CSTLINKMEMBERSCHECKED WHERE CSTLINKMEMBERS1=0) a,
0
Comment
Question by:MoriPi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
jrb1 earned 1000 total points
ID: 16908990
how many rows are in CSTLINKMEMBERSCHECKED?  If there are zero rows, your select from the table will return zero rows.
0
 

Author Comment

by:MoriPi
ID: 16909230
ommm *worships the ground jrb1 walks on*
0
 
LVL 25

Expert Comment

by:jrb1
ID: 16911528
bless you my child
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question