473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Access 2000 Count Issue

Using Access 2000 on WinXP

Alright so here's how what I have is set up, well simplified version.

I have a Program Table, a Procedure Table and a Status Table.

Program - Table
ProgramID
ProgramName

Procedure - Table
ProcedureID
ProcedureName
ProgramID
StatusID

Status - Table
StatusID
StatusName

Each program has a status, and each procedure has a status there making it a one to many relationship from the status to the program table and procedure table. Each program can have many procedures making this a one to many also.

I need to group the procedures according to what program they are a part of. And count how many procedures are part of each status but the catch is. I need to show all the statuses(sp?) even when none of the procedures have that status.

The query should come out something like this:

Program1
Status1 5
Status2 0 << instance where there isnt actually a procedure in that grouping with this status, right now these aren't showing up at all
Status3 6

Right now its coming out as this:

Program1
Status1 5
Status3 6

IF that makes sense I have this

SELECT Procedure.ProgramID, Count(Procedure.Status) AS CountOfStatus, Procedure.Status
FROM Status INNER JOIN [Procedure] ON Status.StatusID = Procedure.Status
GROUP BY Procedure.ProgramID, Procedure.Status
HAVING (((Procedure.Status) Between 1 And 5))
ORDER BY Procedure.Status;
Jul 13 '07 #1
1 1065
Rabbit
12,516 Expert Mod 8TB
If I understand correctly, you need a second query.

Expand|Select|Wrap|Line Numbers
  1. SELECT ProgramID, Status, Nz(CountOfStatus, 0) As NewCount
  2. FROM FirstQuery RIGHT JOIN Status ON FirstQuery.Status = Status.StatusID;
  3.  
Jul 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
1
by: David Conorozzo | last post by:
I create a new Access.Application instance. As soon as I refernce the property "References", I am unable to issue a truly successful quit on that instance. By that I mean the call to quit is fine...
1
by: P.Pfister | last post by:
hi all i have this short source code: --- Dim varElem As Variant Dim strSQL As String Dim i As Integer Dim frm As Form Set dbs = CurrentDb
4
by: Dalan | last post by:
After reading and experiencing the phenomenon of installing MS Office 2000 on a system that already has MS Office 97, or for that matter just Access 97 Runtime, I saw the ugliness that ensues. If...
10
by: B Moor | last post by:
Host PC: Win SBS 2003 with 2.6 GHz processor and 1GB RAM SQL Server 2000 sp3 (or latest).MS Office 2k3 I have the access 2k3 front end running on server (this may get changed) and all was well...
1
by: B Moor | last post by:
Hello, I am quite bogged down with this problem and would like some tips/help if any one has any. Thanks in advance. The Problem ----------- This system initially seemed quite stable for...
7
by: Rob Richardson | last post by:
Greetings! I am rewriting a VB6 application in VB .Net. The database (which was converted from Access 97 into Access 2000) has two nearly identical queries. One, called GetNewOrderNumber, is: ...
17
by: DaveG | last post by:
Hi all I am planning on writing a stock and accounts program for the family business, I understand this is likely to take close to 2 years to accomplish. The stock is likely to run into over a...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.