A
Amy Blankenship
I have a union query that takes data out of two columns in a parameter query
and puts it into one column. I had a version of the query that only got
prompted once for the parameter:
SELECT getCategoryQuestions.SubCatMajor,
Count(getCategoryQuestions.SubCatMajor) AS CatCount, 2 AS Weight
FROM getCategoryQuestions
GROUP BY getCategoryQuestions.SubCatMajor
UNION SELECT getCategoryQuestions.subcatminor,
Count(getCategoryQuestions.subcatminor) AS CatCount, 1 AS Weight
FROM getCategoryQuestions
GROUP BY getCategoryQuestions.subcatminor
ORDER BY Weight DESC;
However, that doesn't quite do what I want, so I changed it to
SELECT getCategoryQuestions.SubCatMajor,
Count(getCategoryQuestions.SubCatMajor) AS CatCount, 2 *
Count(getCategoryQuestions.SubCatMajor) AS NumPoints
FROM getCategoryQuestions
GROUP BY getCategoryQuestions.SubCatMajor
UNION SELECT getCategoryQuestions.SubCatMinor,
Count(getCategoryQuestions.SubCatMinor) AS CatCount, 1 *
Count(getCategoryQuestions.SubCatMinor) AS NumPoints
FROM getCategoryQuestions
GROUP BY getCategoryQuestions.SubCatMinor;
However, this gets prompted twice for the same parameter. Any thoughts as
to what the difference might be?
Thanks;
Amy
and puts it into one column. I had a version of the query that only got
prompted once for the parameter:
SELECT getCategoryQuestions.SubCatMajor,
Count(getCategoryQuestions.SubCatMajor) AS CatCount, 2 AS Weight
FROM getCategoryQuestions
GROUP BY getCategoryQuestions.SubCatMajor
UNION SELECT getCategoryQuestions.subcatminor,
Count(getCategoryQuestions.subcatminor) AS CatCount, 1 AS Weight
FROM getCategoryQuestions
GROUP BY getCategoryQuestions.subcatminor
ORDER BY Weight DESC;
However, that doesn't quite do what I want, so I changed it to
SELECT getCategoryQuestions.SubCatMajor,
Count(getCategoryQuestions.SubCatMajor) AS CatCount, 2 *
Count(getCategoryQuestions.SubCatMajor) AS NumPoints
FROM getCategoryQuestions
GROUP BY getCategoryQuestions.SubCatMajor
UNION SELECT getCategoryQuestions.SubCatMinor,
Count(getCategoryQuestions.SubCatMinor) AS CatCount, 1 *
Count(getCategoryQuestions.SubCatMinor) AS NumPoints
FROM getCategoryQuestions
GROUP BY getCategoryQuestions.SubCatMinor;
However, this gets prompted twice for the same parameter. Any thoughts as
to what the difference might be?
Thanks;
Amy