J
jmoore
In one of several subreports, I am having problems with the grouping order.
The subreport is based on a crosstab query that is based on a union query.
This subreport is the only one with this problem because it is the only one
where the Question number exceeds a single digit. The grouping is set A to Z
on Question, but does not sort correctly because it is text field with
number. Is there an easy way, or even possible, to have it sort in numerical
order as the other subreports that have only single digits mixed with text?
Here is how the first report I ran sorts (null fields do not display):
F10C, F11C, F1C, F22C, F2C, F5C, F6C, F7C.
I am including the SQL for the 2 queries in case that is helpful.
qYr2Comments_F_Union_Count
SELECT qYr2CommentsSummary_F_Union.CNTYNAME,
qYr2CommentsSummary_F_Union.Question, qYr2CommentsSummary_F_Union.Answer,
Count(qYr2CommentsSummary_F_Union.Answer) AS CountofComments
FROM qYr2CommentsSummary_F_Union
GROUP BY qYr2CommentsSummary_F_Union.CNTYNAME,
qYr2CommentsSummary_F_Union.Question, qYr2CommentsSummary_F_Union.Answer;
qYr2CommentsSummary_f_Union
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F1C" as
Question, [F1C] as Answer
FROM [qYr2ReviewSample]
WHERE [F1C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F2C" as
Question, [F2C] as Answer
FROM [qYr2ReviewSample]
WHERE [F2C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F3C" as
Question, [F3C] as Answer
FROM [qYr2ReviewSample]
WHERE [F3C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F4C" as
Question, [F4C] as Answer
FROM [qYr2ReviewSample]
WHERE [F4C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F5C" as
Question, [F5C] as Answer
FROM [qYr2ReviewSample]
WHERE [F5C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F6C" as
Question, [F6C] as Answer
FROM [qYr2ReviewSample]
WHERE [F6C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F7C" as
Question, [F7C] as Answer
FROM [qYr2ReviewSample]
WHERE [F7C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F10C" as
Question, [F10C] as Answer
FROM [qYr2ReviewSample]
WHERE [F10C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F11C" as
Question, [F11C] as Answer
FROM [qYr2ReviewSample]
WHERE [F11C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F13C" as
Question, [F13C] as Answer
FROM [qYr2ReviewSample]
WHERE [F13C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F14C" as
Question, [F14C] as Answer
FROM [qYr2ReviewSample]
WHERE [F14C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F22C" as
Question, [F22C] as Answer
FROM [qYr2ReviewSample]
WHERE [F22C] Is Not Null
UNION ALL SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey,
"F24C" as Question, [F24C] as Answer
FROM [qYr2ReviewSample]
WHERE [F24C] Is Not Null;
The subreport is based on a crosstab query that is based on a union query.
This subreport is the only one with this problem because it is the only one
where the Question number exceeds a single digit. The grouping is set A to Z
on Question, but does not sort correctly because it is text field with
number. Is there an easy way, or even possible, to have it sort in numerical
order as the other subreports that have only single digits mixed with text?
Here is how the first report I ran sorts (null fields do not display):
F10C, F11C, F1C, F22C, F2C, F5C, F6C, F7C.
I am including the SQL for the 2 queries in case that is helpful.
qYr2Comments_F_Union_Count
SELECT qYr2CommentsSummary_F_Union.CNTYNAME,
qYr2CommentsSummary_F_Union.Question, qYr2CommentsSummary_F_Union.Answer,
Count(qYr2CommentsSummary_F_Union.Answer) AS CountofComments
FROM qYr2CommentsSummary_F_Union
GROUP BY qYr2CommentsSummary_F_Union.CNTYNAME,
qYr2CommentsSummary_F_Union.Question, qYr2CommentsSummary_F_Union.Answer;
qYr2CommentsSummary_f_Union
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F1C" as
Question, [F1C] as Answer
FROM [qYr2ReviewSample]
WHERE [F1C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F2C" as
Question, [F2C] as Answer
FROM [qYr2ReviewSample]
WHERE [F2C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F3C" as
Question, [F3C] as Answer
FROM [qYr2ReviewSample]
WHERE [F3C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F4C" as
Question, [F4C] as Answer
FROM [qYr2ReviewSample]
WHERE [F4C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F5C" as
Question, [F5C] as Answer
FROM [qYr2ReviewSample]
WHERE [F5C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F6C" as
Question, [F6C] as Answer
FROM [qYr2ReviewSample]
WHERE [F6C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F7C" as
Question, [F7C] as Answer
FROM [qYr2ReviewSample]
WHERE [F7C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F10C" as
Question, [F10C] as Answer
FROM [qYr2ReviewSample]
WHERE [F10C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F11C" as
Question, [F11C] as Answer
FROM [qYr2ReviewSample]
WHERE [F11C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F13C" as
Question, [F13C] as Answer
FROM [qYr2ReviewSample]
WHERE [F13C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F14C" as
Question, [F14C] as Answer
FROM [qYr2ReviewSample]
WHERE [F14C] Is Not Null
UNION ALL
SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey, "F22C" as
Question, [F22C] as Answer
FROM [qYr2ReviewSample]
WHERE [F22C] Is Not Null
UNION ALL SELECT [qYr2ReviewSample].CNTYNAME, [qYr2ReviewSample].ReviewKey,
"F24C" as Question, [F24C] as Answer
FROM [qYr2ReviewSample]
WHERE [F24C] Is Not Null;