sort in report

G

Guest

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?
 
F

fredg

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.
 
G

Guest

Fred,

I cannot get your instructions to work. There are only 4 building names, so
I'm trying to use your first suggestion. But, it is not sorting properly.
Could you review your directions to me and maybe make further clarification.
P.S. When I try to sort on the [SortThis] field, it makes me choose ascending
or descending and it is also showing an [Expression] field that I don't know
where it came from.

I appreciate your help.

fredg said:
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.
 
F

fredg

Fred,

I cannot get your instructions to work. There are only 4 building names, so
I'm trying to use your first suggestion. But, it is not sorting properly.
Could you review your directions to me and maybe make further clarification.
P.S. When I try to sort on the [SortThis] field, it makes me choose ascending
or descending and it is also showing an [Expression] field that I don't know
where it came from.

I appreciate your help.

fredg said:
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.

Gee, if you don't know where that Expression Field came from, with the
information you have given, neither do I. Does it have a name?

Here's what I need.
Post the SQL of the query that is used as the report's record source.

Also, enter the BuildingNames in the order you wish to see them in the
report. Don't forget to tell me the name of the Field that contains
these building names.

In addition, tell me what the actual Report's Sorting and Grouping is
(you'll have to manually type it, i,e, somethiiong like this:
SortThis Ascending
[LastName] Ascending
etc....
 
G

Guest

Fred,

When I looked at the problem with fresh eyes this morning, I realized the
problem. Your instructions were fine and I followed them correctly. The
problem was that the building names on some of the records had been typed in
by hand (not using the drop down box) and they had spaces missing between
some of the words in the building name. So, they were appearing first on the
report, before the rest of the records with the correct building names.

Thank you very much for all of your help.



fredg said:
Fred,

I cannot get your instructions to work. There are only 4 building names, so
I'm trying to use your first suggestion. But, it is not sorting properly.
Could you review your directions to me and maybe make further clarification.
P.S. When I try to sort on the [SortThis] field, it makes me choose ascending
or descending and it is also showing an [Expression] field that I don't know
where it came from.

I appreciate your help.

fredg said:
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.

Gee, if you don't know where that Expression Field came from, with the
information you have given, neither do I. Does it have a name?

Here's what I need.
Post the SQL of the query that is used as the report's record source.

Also, enter the BuildingNames in the order you wish to see them in the
report. Don't forget to tell me the name of the Field that contains
these building names.

In addition, tell me what the actual Report's Sorting and Grouping is
(you'll have to manually type it, i,e, somethiiong like this:
SortThis Ascending
[LastName] Ascending
etc....
 
F

fredg

Fred,

When I looked at the problem with fresh eyes this morning, I realized the
problem. Your instructions were fine and I followed them correctly. The
problem was that the building names on some of the records had been typed in
by hand (not using the drop down box) and they had spaces missing between
some of the words in the building name. So, they were appearing first on the
report, before the rest of the records with the correct building names.

Thank you very much for all of your help.

fredg said:
Fred,

I cannot get your instructions to work. There are only 4 building names, so
I'm trying to use your first suggestion. But, it is not sorting properly.
Could you review your directions to me and maybe make further clarification.
P.S. When I try to sort on the [SortThis] field, it makes me choose ascending
or descending and it is also showing an [Expression] field that I don't know
where it came from.

I appreciate your help.

:

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.

Gee, if you don't know where that Expression Field came from, with the
information you have given, neither do I. Does it have a name?

Here's what I need.
Post the SQL of the query that is used as the report's record source.

Also, enter the BuildingNames in the order you wish to see them in the
report. Don't forget to tell me the name of the Field that contains
these building names.

In addition, tell me what the actual Report's Sorting and Grouping is
(you'll have to manually type it, i,e, somethiiong like this:
SortThis Ascending
[LastName] Ascending
etc....

It has been repeatedly tested, and it is now a scientifically accepted
fact that two fresh eyes in the morning are better than 4 tired eyes
in the evening. :)

Happy to have helped.
 

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