Solved

MsAccess bug? or query wrong?

Posted on 2006-06-14
3
197 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
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
jrb1 earned 250 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now