M
midnite oit
Hello,
This query was originally put in the RecordSource in the report's properties
sheet. The results are good and sorted by Year followed by month.
I modified the report and to put this query in code in the on_open form
event and have the Report.RecordSource = strSQL. The results in the report
are not ordered by Year, Month. I have a breakpoint in the code and am able
to get the strSQL statement from the immediate window, cut and paste in the
query window and it works fine - the results are ordered by Year, Month.
"SELECT [Month Query].Year, [Month Query].Month, Sum([Month
Query].NumberInitial) AS [Number of Reports], Months.MonthLong, Sum([Month
Query].NumberFU) AS [Number of FU Reports]
FROM [Month Query] INNER JOIN Months ON [Month Query].Month=Months.Month
GROUP BY [Month Query].Year, [Month Query].Month, Months.MonthLong
ORDER BY [Month Query].Year DESC , [Month Query].Month DESC;"
My work around is define the sort order in the Grouping and Sorting box and
that works fine for me.
Does anyone know and would appreciate your explanation on this different
behavior.
This query was originally put in the RecordSource in the report's properties
sheet. The results are good and sorted by Year followed by month.
I modified the report and to put this query in code in the on_open form
event and have the Report.RecordSource = strSQL. The results in the report
are not ordered by Year, Month. I have a breakpoint in the code and am able
to get the strSQL statement from the immediate window, cut and paste in the
query window and it works fine - the results are ordered by Year, Month.
"SELECT [Month Query].Year, [Month Query].Month, Sum([Month
Query].NumberInitial) AS [Number of Reports], Months.MonthLong, Sum([Month
Query].NumberFU) AS [Number of FU Reports]
FROM [Month Query] INNER JOIN Months ON [Month Query].Month=Months.Month
GROUP BY [Month Query].Year, [Month Query].Month, Months.MonthLong
ORDER BY [Month Query].Year DESC , [Month Query].Month DESC;"
My work around is define the sort order in the Grouping and Sorting box and
that works fine for me.
Does anyone know and would appreciate your explanation on this different
behavior.