Sort a group

B

bbypookins

I have a report with a group which has a row source of

SELECT tblDivision.Division FROM tblDivision ORDER BY tblDivision.Prefix;

It's supposed to be sorting by the field "Prefix" which is in the
tblDivision, but it's sorting alphabetically by the field "Division". What am
I doing wrong?
 
F

fredg

I have a report with a group which has a row source of

SELECT tblDivision.Division FROM tblDivision ORDER BY tblDivision.Prefix;

It's supposed to be sorting by the field "Prefix" which is in the
tblDivision, but it's sorting alphabetically by the field "Division". What am
I doing wrong?

Any sort order in the query is irrelevant to the sort order of the
report.
To sort the report, use the report's Sorting and Grouping dialog.
In Report Design View, click on
View + Sorting and Grouping
 
B

bbypookins

Okay, but it only gives the option of alphebetizing it. I need to sort that
group by a number that isn't even in the report. Is that possible?
 
F

fredg

Okay, but it only gives the option of alphebetizing it. I need to sort that
group by a number that isn't even in the report. Is that possible?

You can write an expression in the Field/Expression column, i.e.
=Left([SomeField],4)

However, if the table includes a field named [Prefix} why not simply
include it in the record source query? Or create a new column in the
query and use the expression there.
Now you can use that new query field as the field to sort the report
on in Sorting and Grouping.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top