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.Progr amID, Count(Procedure .Status) AS CountOfStatus, Procedure.Statu s
FROM Status INNER JOIN [Procedure] ON Status.StatusID = Procedure.Statu s
GROUP BY Procedure.Progr amID, Procedure.Statu s
HAVING (((Procedure.St atus) Between 1 And 5))
ORDER BY Procedure.Statu s;
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.Progr amID, Count(Procedure .Status) AS CountOfStatus, Procedure.Statu s
FROM Status INNER JOIN [Procedure] ON Status.StatusID = Procedure.Statu s
GROUP BY Procedure.Progr amID, Procedure.Statu s
HAVING (((Procedure.St atus) Between 1 And 5))
ORDER BY Procedure.Statu s;
Comment