Sorting text field value in a report


D

DJ

I have a report that is not based on a query. It's pulling data straight
from a table. There are a number of calculated values (text fields) in the
report that are not fields in the table. There is a final calculated value
(text field) in the report that is also not a field in the table. Is there a
way to sort the report (ascending or descending) based on the calculated
values in that final field?
 
Ad

Advertisements

D

Duane Hookom

Sure. You can sort on a calculated value as long as it is not an aggregated
value. For instance, you could set the sorting and grouping control source to:
=[LastName] & [Firstname]
 
D

DJ

Not sure what an aggregated value is, but I must be working with one. The
text field I'm trying to sort on ([Text29]) is a calculated value (e.g.
[Text13]-[Text20]). EACH of the fields Text13 and Text20 are text fields
containing other calculations. Finally, some of the fields used within THOSE
calculations are calculations within themselves. I realize now that I should
have probably done a query in lieu of building the report straight from a
table. However, is there a way to sort on field [Text29] or is there not?

Duane Hookom said:
Sure. You can sort on a calculated value as long as it is not an aggregated
value. For instance, you could set the sorting and grouping control source to:
=[LastName] & [Firstname]

--
Duane Hookom
Microsoft Access MVP


DJ said:
I have a report that is not based on a query. It's pulling data straight
from a table. There are a number of calculated values (text fields) in the
report that are not fields in the table. There is a final calculated value
(text field) in the report that is also not a field in the table. Is there a
way to sort the report (ascending or descending) based on the calculated
values in that final field?
 
G

golfinray

"Aggregate" fields are field with calculations. Usually those don't sort. One
option I use sometimes is to use a query, which will then usually sort.
Another option is to query, then make-table out of the query after you get
the results you want.
--
Milton Purdy
ACCESS
State of Arkansas


DJ said:
Not sure what an aggregated value is, but I must be working with one. The
text field I'm trying to sort on ([Text29]) is a calculated value (e.g.
[Text13]-[Text20]). EACH of the fields Text13 and Text20 are text fields
containing other calculations. Finally, some of the fields used within THOSE
calculations are calculations within themselves. I realize now that I should
have probably done a query in lieu of building the report straight from a
table. However, is there a way to sort on field [Text29] or is there not?

Duane Hookom said:
Sure. You can sort on a calculated value as long as it is not an aggregated
value. For instance, you could set the sorting and grouping control source to:
=[LastName] & [Firstname]

--
Duane Hookom
Microsoft Access MVP


DJ said:
I have a report that is not based on a query. It's pulling data straight
from a table. There are a number of calculated values (text fields) in the
report that are not fields in the table. There is a final calculated value
(text field) in the report that is also not a field in the table. Is there a
way to sort the report (ascending or descending) based on the calculated
values in that final field?
 
Ad

Advertisements

D

Duane Hookom

You can't reference a control on the report in the sorting and grouping.
An "aggregated value" is the result of Sum() or Avg() or Max() or ...

Can we assume your text boxes are based on field values in your report's
record source? If so, you can drill back to those fields to use in the
sorting and grouping.

--
Duane Hookom
Microsoft Access MVP


DJ said:
Not sure what an aggregated value is, but I must be working with one. The
text field I'm trying to sort on ([Text29]) is a calculated value (e.g.
[Text13]-[Text20]). EACH of the fields Text13 and Text20 are text fields
containing other calculations. Finally, some of the fields used within THOSE
calculations are calculations within themselves. I realize now that I should
have probably done a query in lieu of building the report straight from a
table. However, is there a way to sort on field [Text29] or is there not?

Duane Hookom said:
Sure. You can sort on a calculated value as long as it is not an aggregated
value. For instance, you could set the sorting and grouping control source to:
=[LastName] & [Firstname]

--
Duane Hookom
Microsoft Access MVP


DJ said:
I have a report that is not based on a query. It's pulling data straight
from a table. There are a number of calculated values (text fields) in the
report that are not fields in the table. There is a final calculated value
(text field) in the report that is also not a field in the table. Is there a
way to sort the report (ascending or descending) based on the calculated
values in that final field?
 

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