The type mismatch is coming from the highlighted part of the SQL statement:
SELECT [Promo count].PromoNo, [Promo count].[# of Demos], Count(DemoOrder.Status) AS CountOfStatus,
[DemoOrder]![Status]/[Promo count]![# of Demos] AS Percentage
FROM [Promo count] INNER JOIN DemoOrder ON [Promo count].PromoNo = DemoOrder.PromoNo
GROUP BY [Promo count].PromoNo, [Promo count].[# of Demos], [DemoOrder]![Status]/[Promo count]![# of Demos]
HAVING (((Count(DemoOrder.Status))="E"));
You can't divide the status (a string) by a number. Hence the type mismatch.
I tried the following query which at least does not generate errors (does it generate the results that you are looking for??)
Are we getting closer?
- g
SELECT [Promo count].PromoNo, [Promo count].[# of Demos], Count(DemoOrder.Status) AS CountOfStatus,
[DemoOrder]![Status]/[Promo count]![# of Demos] AS Percentage
FROM [Promo count] INNER JOIN DemoOrder ON [Promo count].PromoNo = DemoOrder.PromoNo
GROUP BY [Promo count].PromoNo, [Promo count].[# of Demos], [DemoOrder]![Status]/[Promo count]![# of Demos]
HAVING (((Count(DemoOrder.Status))="E"));
You can't divide the status (a string) by a number. Hence the type mismatch.
I tried the following query which at least does not generate errors (does it generate the results that you are looking for??)
Code:
SELECT [Promo count].PromoNo, [Promo count].[# of Demos], Count(DemoOrder.Status) AS CountOfStatus,
CountOfStatus/[# of Demos] AS Percentage
FROM [Promo count] INNER JOIN DemoOrder ON [Promo count].PromoNo = DemoOrder.PromoNo
WHERE DemoOrder.Status = "E"
GROUP BY [Promo count].PromoNo, [Promo count].[# of Demos]
Are we getting closer?
- g