Re: sort in report



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
.



Relevant Pages

  • RE: Combo Box Problem
    ... "Your Record Source query doesn't appear to have an filter. ... record source query it won't display in the report? ... "Duane Hookom" wrote: ...
    (microsoft.public.access.reports)
  • Re: Query form coding
    ... The record source for the list box "namelst" is: ... The report record source seems to give the desired records. ... The code for the button (create the filter) works if no names have been selected in the names list box. ... I have tried to include the query when using the wizard to design the report but I keep getting an error saying I have used a table or query that is based on a table or query and when I remove the query fields from the list it allow me to continue with the report design. ...
    (microsoft.public.access.formscoding)
  • Re: Create sums on different groupings?
    ... You could base your main report on the group by and totals query I suggested ... by Name, date, and Amount. ... Then add this query to your report's record source so you have the 375" ...
    (microsoft.public.access.reports)
  • Re: Create sums on different groupings?
    ... I used Query1 as the record source for the main report and Query2 as the ... "Duane Hookom" wrote: ... You could base your main report on the group by and totals query I ...
    (microsoft.public.access.reports)
  • Re: Create sums on different groupings?
    ... I used Query1 as the record source for the main report and Query2 as the ... "Duane Hookom" wrote: ... You could base your main report on the group by and totals query I suggested ...
    (microsoft.public.access.reports)