First off, I am using Access 2002.
I have a data set, and i am trying to Group By certain demographic files in my db (q59 as Sex1, in this example). Here is the code I have so far:
Now, the reason I have it like this is for reporting purposes, I need to display the results, even if it is a 0. Right now, that returns the data, grouped correctly.... but say for example that there is no result of '2' in group '2'. It will not return any record displaying 0 (since there is nothing to count).
Is there any way I can have this query return zeroes even in my group by? I understant I may not have explained this very well, but any help is appreciated.
I have a data set, and i am trying to Group By certain demographic files in my db (q59 as Sex1, in this example). Here is the code I have so far:
Code:
select 2 as QID, 1 as RID, "Yes" as QText, count(Q2) as Result, Avg(Q59) as Sex1
from sheet1
where Q2 = 1
group by q59
union all
select 2 as QID, 2 as RID, "No" as QText, count(q2) as Result, avg(Q59) as sex1
from sheet1
where q2 = 2
group by q59
Now, the reason I have it like this is for reporting purposes, I need to display the results, even if it is a 0. Right now, that returns the data, grouped correctly.... but say for example that there is no result of '2' in group '2'. It will not return any record displaying 0 (since there is nothing to count).
Is there any way I can have this query return zeroes even in my group by? I understant I may not have explained this very well, but any help is appreciated.