If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How do I sort on a calculated field in a report?
I created a calculated, unbound field in a report that i have to sort on. Can
anyone help me figure out how to? Thanks. |
#2
|
|||
|
|||
How do I sort on a calculated field in a report?
Add the calculated field to the Report RecordSource
Select TableName.* , [Field1]+[Field2] As NewField From TableName Then in the report Grouping and Sorting add the new field "NewField" and sort by it. To sort the report by any field it need to be in the Report RecordSource -- Good Luck BS"D "Need Help" wrote: I created a calculated, unbound field in a report that i have to sort on. Can anyone help me figure out how to? Thanks. |
#3
|
|||
|
|||
How do I sort on a calculated field in a report?
I'm not sure what you mean by "Select TableName". The calculated field is not
in the table. I added this field in the report to calculate percentage on two other fields that are in the table. Thanks, "Ofer Cohen" wrote: Add the calculated field to the Report RecordSource Select TableName.* , [Field1]+[Field2] As NewField From TableName Then in the report Grouping and Sorting add the new field "NewField" and sort by it. To sort the report by any field it need to be in the Report RecordSource -- Good Luck BS"D "Need Help" wrote: I created a calculated, unbound field in a report that i have to sort on. Can anyone help me figure out how to? Thanks. |
#4
|
|||
|
|||
How do I sort on a calculated field in a report?
|
#5
|
|||
|
|||
How do I sort on a calculated field in a report?
I know that the calculaed field is not in the form, but the formula in the
calculated field probably consist the field from the table Something like =[Field1]+[Field2] So, to the reprot RcordSource you can add another field NewField: [Field1]+[Field2] And then sort by the "NewField" If you need help, please post the report RecordSource and the Control Source of the calculated text box -- Good Luck BS"D "Need Help" wrote: I'm not sure what you mean by "Select TableName". The calculated field is not in the table. I added this field in the report to calculate percentage on two other fields that are in the table. Thanks, "Ofer Cohen" wrote: Add the calculated field to the Report RecordSource Select TableName.* , [Field1]+[Field2] As NewField From TableName Then in the report Grouping and Sorting add the new field "NewField" and sort by it. To sort the report by any field it need to be in the Report RecordSource -- Good Luck BS"D "Need Help" wrote: I created a calculated, unbound field in a report that i have to sort on. Can anyone help me figure out how to? Thanks. |
#6
|
|||
|
|||
How do I sort on a calculated field in a report?
'No controls on the report' you mean I can't include another calculated field
in this expression? - Field2/Field3, where Field 3 is another calculation not included in the table. When I copied the calculation into the Grouping and Sorting, it gave me an error message. I can't get it work. I have two fields in the table and two calculated fields in the report. Field1 and Field2 are entered in the table. [Field3] is a calculation on [Field1*45]. [Field4] is a calculation on [Field2]/[Field3]. Thanks for your help. "Marshall Barton" wrote: Need Help Need wrote: I created a calculated, unbound field in a report that i have to sort on. Can anyone help me figure out how to? Put the expression for the calculation in Sorting and Grouping. Be sure to only refer to fields in the report's record source table/query and no controls on the report. -- Marsh MVP [MS Access] |
#7
|
|||
|
|||
How do I sort on a calculated field in a report?
'No controls on the report' you mean I can't include another calculated field
in this expression? My calculation is [Field2]/[Field3] where Field2 is in the table and Field3 is a calculated field in the report. If I copy it into the Grouping and Sorting, it gives me an error message: "Field3" "Marshall Barton" wrote: Need Help Need wrote: I created a calculated, unbound field in a report that i have to sort on. Can anyone help me figure out how to? Put the expression for the calculation in Sorting and Grouping. Be sure to only refer to fields in the report's record source table/query and no controls on the report. -- Marsh MVP [MS Access] |
#8
|
|||
|
|||
How do I sort on a calculated field in a report?
Marshall,
I eliminated the control on the report and copied the expression into Grouping and Sorting. It worked. Thanks for your help. "Need Help" wrote: 'No controls on the report' you mean I can't include another calculated field in this expression? My calculation is [Field2]/[Field3] where Field2 is in the table and Field3 is a calculated field in the report. If I copy it into the Grouping and Sorting, it gives me an error message: "Field3" "Marshall Barton" wrote: Need Help Need wrote: I created a calculated, unbound field in a report that i have to sort on. Can anyone help me figure out how to? Put the expression for the calculation in Sorting and Grouping. Be sure to only refer to fields in the report's record source table/query and no controls on the report. -- Marsh MVP [MS Access] |
#9
|
|||
|
|||
How do I sort on a calculated field in a report?
You got the error because your expression used control names
instead of field names. I guess the expression you need to use could be: =Field2 / (Field1 * 45) which uses only **fields** from the table/query. You can use the same calculation in the report's record source query as Ofer suggested. It might be easier to understand, but it makes no difference to the report. Part of your confusion is because you are using the word "field" in an ambiguous way. Fields are columns in a table or query. Controls are the thingies you have in the form/report that display the value of a field or expression. A lot of people use field for either one, but not in a discussion about both where you need to distinguish between the two different objects. -- Marsh MVP [MS Access] Need Help wrote: 'No controls on the report' you mean I can't include another calculated field in this expression? - Field2/Field3, where Field 3 is another calculation not included in the table. When I copied the calculation into the Grouping and Sorting, it gave me an error message. I can't get it work. I have two fields in the table and two calculated fields in the report. Field1 and Field2 are entered in the table. [Field3] is a calculation on [Field1*45]. [Field4] is a calculation on [Field2]/[Field3]. "Marshall Barton" wrote: Need Help Need wrote: I created a calculated, unbound field in a report that i have to sort on. Can anyone help me figure out how to? Put the expression for the calculation in Sorting and Grouping. Be sure to only refer to fields in the report's record source table/query and no controls on the report. |
Thread Tools | |
Display Modes | |
|
|