Re: Group By Problem - show row even when count = 0
- From: "Andibevan" <andibevan@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Oct 2006 15:38:27 +0100
Thanks Duane - I believe I am concerned with there being no value in the
business column of the query (and therefore the row is not visible).
That doesn't seem to have worked - it shows 0/0 for 'Post Phase 2 - High'
but nothing for post phase 2 critical and low - could it be something else
that is causeing the problem.
From investigating there appear to be no items in the database that are postphase 2 and critical (there are other catagories other than business / test
that the item could be assigned to) - I tried putting a NZ around all parts
of the query but that made no difference
The results are as follows:-
RequiredFor Severity/Closure Business Test
Phase 1 1 Critical 6 0
Phase 1 2 High 8 0
Phase 1 3 Medium 3 0
Phase 1 4 Low 0 0
Phase 2 1 Critical 2 0
Phase 2 2 High 2 0
Phase 2 3 Medium 14 0
Phase 2 4 Low 0 0
Post Phase 2 2 High 0 0
Post Phase 2 3 Medium 1 0
"Duane Hookom" <DuaneAtNoSpanHookomDotNet> wrote in message
news:uPZH5fT7GHA.3960@xxxxxxxxxxxxxxxxxxxxxxx
"If there are no items assigned to the business it doesn't show the row"do
you actually mean it doesn't show the "row" or are you just concernedthere
is no value in the Business column of the query? Try something like theBusiness,
following if you only want to display a zero where there was a null.
SELECT tblApprovedDefects.RequiredFor,
tblApprovedDefects.[Severity/Closure],
Nz(Sum(IIf((LookupResource([AssignedToContact]))="Business",1,0)),0) AS
Business,
Nz(Sum(IIf((LookupResource([AssignedToContact]))="Test",1,0)),0) AS Test
FROM tblApprovedDefects
WHERE (((tblApprovedDefects.ProblemStatus) Not In ("Rejected","Closed")))
GROUP BY tblApprovedDefects.RequiredFor,
tblApprovedDefects.[Severity/Closure];
--
Duane Hookom
MS Access MVP
From: "Andibevan" <andibevan@xxxxxxxxxxxxxxxxxx>
Subject: Group By Problem - show row even when count = 0
Date: Wednesday, October 11, 2006 4:40 AM
I am using the following query:-
SELECT tblApprovedDefects.RequiredFor,
tblApprovedDefects.[Severity/Closure],
Sum(IIf((LookupResource([AssignedToContact]))="Business",1,0)) AS
Sum(IIf((LookupResource([AssignedToContact]))="Test",1,0)) AS TestI
FROM tblApprovedDefects
WHERE (((tblApprovedDefects.ProblemStatus) Not In ("Rejected","Closed")))
GROUP BY tblApprovedDefects.RequiredFor,
tblApprovedDefects.[Severity/Closure];
This ends up with a seperate row in the query for each [Severity/Closure]
and then counts the number of items assigned to Bussiness or Test.
If there are no items assigned to the business it doesn't show the row at
all and only shows Test - how do I modify the query so that it shows both
the business and test rows, even if there are no items to count?
Sorry if this isn't very clear but I am not quite sure how to explain what
want - happy to clarify.("Rejected","Closed")))
TIA
Andi
"Andibevan" <andibevan@xxxxxxxxxxxxxxxxxx> wrote in message
news:uutP$kR7GHA.2248@xxxxxxxxxxxxxxxxxxxxxxx
I am using the following query:-
SELECT tblApprovedDefects.RequiredFor,
tblApprovedDefects.[Severity/Closure],
Sum(IIf((LookupResource([AssignedToContact]))="Business",1,0)) AS
Business,
Sum(IIf((LookupResource([AssignedToContact]))="Test",1,0)) AS Test
FROM tblApprovedDefects
WHERE (((tblApprovedDefects.ProblemStatus) Not In
[Severity/Closure]GROUP BY tblApprovedDefects.RequiredFor,
tblApprovedDefects.[Severity/Closure];
This ends up with a seperate row in the query for each
atand then counts the number of items assigned to Bussiness or Test.
If there are no items assigned to the business it doesn't show the row
bothall and only shows Test - how do I modify the query so that it shows
whatthe business and test rows, even if there are no items to count?
Sorry if this isn't very clear but I am not quite sure how to explain
I
want - happy to clarify.
TIA
Andi
.
- Follow-Ups:
- Re: Group By Problem - show row even when count = 0
- From: Duane Hookom
- Re: Group By Problem - show row even when count = 0
- References:
- Group By Problem - show row even when count = 0
- From: Andibevan
- Re: Group By Problem - show row even when count = 0
- From: Duane Hookom
- Group By Problem - show row even when count = 0
- Prev by Date: Re: Update Label Caption Based On Query Result
- Next by Date: Re: Comparing Two Tables
- Previous by thread: Re: Group By Problem - show row even when count = 0
- Next by thread: Re: Group By Problem - show row even when count = 0
- Index(es):
Relevant Pages
|