"Order By" not working

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am doing a report using the following query as a Record Source:

SELECT [Employment].[EEStartDate], [Employment].[Wage], [Employment].[EE],
[Employment].[JASID], [Employment].[Occupation], [Employment].[Employer]
FROM Employment
WHERE [Employment].[EEStartDate] Between StartDate And EndDate
ORDER BY [Employment].[EE], [Employment].[Wage] DESC;

This query gets the data, but sorts by the EEStartDate, not the "Order By"
line. The "Order by On" property is "No" (filter is also No). EE is either
a "F" or "P" and the wage is defined as currency.

I have tried putting the "Order By" info into the "Order By" property line
(and turning it on) - still no go. It will only sort by the EEStartDate
(DESC).

NOTE: When the query is run outside of the report, it works.

Thanks for any pointers.
John H W
 
Reports usually ignore the ORDER BY clause of the report's recordsource
query. Use the Sorting and Grouping setting for the report instead.

From design view, View | Sorting and Grouping... menu.
 
That worked. Thanks,
John H W

Ken Snell said:
Reports usually ignore the ORDER BY clause of the report's recordsource
query. Use the Sorting and Grouping setting for the report instead.

From design view, View | Sorting and Grouping... menu.
--

Ken Snell
<MS ACCESS MVP>



John H W said:
I am doing a report using the following query as a Record Source:

SELECT [Employment].[EEStartDate], [Employment].[Wage], [Employment].[EE],
[Employment].[JASID], [Employment].[Occupation], [Employment].[Employer]
FROM Employment
WHERE [Employment].[EEStartDate] Between StartDate And EndDate
ORDER BY [Employment].[EE], [Employment].[Wage] DESC;

This query gets the data, but sorts by the EEStartDate, not the "Order By"
line. The "Order by On" property is "No" (filter is also No). EE is
either
a "F" or "P" and the wage is defined as currency.

I have tried putting the "Order By" info into the "Order By" property line
(and turning it on) - still no go. It will only sort by the EEStartDate
(DESC).

NOTE: When the query is run outside of the report, it works.

Thanks for any pointers.
John H W
 
Back
Top