Numpty
on t'internet
- Local time
- Today, 20:55
- Joined
- Apr 11, 2003
- Messages
- 60
I have created a crosstab query which displays the number "Delegates" within our database who fall into certain ethnic categories, also listed by sex.
The query I have created so far will display the count of delegates within a category as long as it has an entry. What I would like it to do is also display zero if we have no delegates in that category. That is where my problem lies, I can't get that part to work.
The expression I am using is:
(IIf(Count([DelegateID])>0,Count([DelegateID]),0))
The full SQL for the query is:
TRANSFORM (IIf(Count([DelegateID])>0,Count([DelegateID]),0)) AS [Count]
SELECT [EthnicOrigin].[EthnicGroupID], [EthnicOrigin].[EthnicGroup]
FROM Delegates INNER JOIN EthnicOrigin ON [Delegates].[EthnicGroupID]=[EthnicOrigin].[EthnicGroupID]
GROUP BY [EthnicOrigin].[EthnicGroupID], [EthnicOrigin].[EthnicGroup]
PIVOT [Delegates].[Sex];
Any help greatly appreciated and will keep my hair in its rightful place for one more day........
The query I have created so far will display the count of delegates within a category as long as it has an entry. What I would like it to do is also display zero if we have no delegates in that category. That is where my problem lies, I can't get that part to work.
The expression I am using is:
(IIf(Count([DelegateID])>0,Count([DelegateID]),0))
The full SQL for the query is:
TRANSFORM (IIf(Count([DelegateID])>0,Count([DelegateID]),0)) AS [Count]
SELECT [EthnicOrigin].[EthnicGroupID], [EthnicOrigin].[EthnicGroup]
FROM Delegates INNER JOIN EthnicOrigin ON [Delegates].[EthnicGroupID]=[EthnicOrigin].[EthnicGroupID]
GROUP BY [EthnicOrigin].[EthnicGroupID], [EthnicOrigin].[EthnicGroup]
PIVOT [Delegates].[Sex];
Any help greatly appreciated and will keep my hair in its rightful place for one more day........