Re: sort in report
- From: fredg <fgutkind@xxxxxxxxxxxxxxx>
- Date: Thu, 11 Oct 2007 13:37:40 -0700
On Thu, 11 Oct 2007 12:27:01 -0700, cc wrote:
My database has a field that is a drop down box with four building names. I
want to sort the report by building, but I don't want the buildings in
alphabetical order. How do I sort/group that field so that the buildings
appear in the specific order that I want?
In the query that is used as the report's record source, add a new
column.
SortThis:Switch([FieldName] = "BuildingC",1, [FieldName = "BuildingZ"
,2,[FieldName] = "BuildingA",3)
Then use this column in the Report's Sorting and Grouping dialog to
order the records by.
In the above the report will be ordered by
BuildingC
BuildingZ
BuildingA
Alternatively, if you have quite a few more buildings, I would suggest
a separate Building Table with a BuildingID, Building Name, and a
SortThis field.
Then establish a relationship between this table and the main table.
Then include the SortThis field in the query. The SorthThis number
will be included in the query.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.
- Prev by Date: RE: Report/Query not selecting specific records
- Next by Date: Re: Run Time Error 2501 "The report action was cancel"
- Previous by thread: RE: Report/Query not selecting specific records
- Next by thread: Re: sort in report
- Index(es):
Relevant Pages
|