![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a select query that groups records together, specifically baseball players and their home runs and at-bats. I want to create a query that displays [HR's], [AB's], and [HR's per AB's] and that sorts ASCENDING on the [HR's per AB's] field. My field is: AB_per_HR: [AB]/[HR] If I set the SORT to Ascending, I get an error message saying I tried to execute a query that does not include the specified expression as part of an aggregate function. If I leave the TOTAL and SORT specifications empty, then the query works, but does not display in sorted order on the HR. How do I get the query to perform the divide function AND display the results sorting on the field that does the divide? Thank you. --- Allen Does your OrderBy statement look like |
#3
| |||
| |||
|
|
Otie wrote: I have a select query that groups records together, specifically baseball players and their home runs and at-bats. I want to create a query that displays [HR's], [AB's], and [HR's per AB's] and that sorts ASCENDING on the [HR's per AB's] field. My field is: AB_per_HR: [AB]/[HR] If I set the SORT to Ascending, I get an error message saying I tried to execute a query that does not include the specified expression as part of an aggregate function. If I leave the TOTAL and SORT specifications empty, then the query works, but does not display in sorted order on the HR. How do I get the query to perform the divide function AND display the results sorting on the field that does the divide? Thank you. --- Allen Does your OrderBy statement look like order By [HR's per AB's] or does it looke like Order By [HR]/[AB] The second one should work. |
#4
| |||
| |||
|
|
I have a select query that groups records together, specifically baseball players and their home runs and at-bats. I want to create a query that displays [HR's], [AB's], and [HR's per AB's] and that sorts ASCENDING on the [HR's per AB's] field. My field is: AB_per_HR: [AB]/[HR] If I set the SORT to Ascending, I get an error message saying I tried to execute a query that does not include the specified expression as part of an aggregate function. If I leave the TOTAL and SORT specifications empty, then the query works, but does not display in sorted order on the HR. How do I get the query to perform the divide function AND display the results sorting on the field that does the divide? Thank you. --- Allen |
#5
| |||
| |||
|
|
Did you get an answer yet? How about feeding the data into a report, which would have a textbox doing the calc yyou want.. Alan "Otie" <otie_nospam (AT) adelphia (DOT) net> wrote in message news:xpKdnU1-OeQPkQPfRVn-1g (AT) adelphia (DOT) com... I have a select query that groups records together, specifically baseball players and their home runs and at-bats. I want to create a query that displays [HR's], [AB's], and [HR's per AB's] and that sorts ASCENDING on the [HR's per AB's] field. My field is: AB_per_HR: [AB]/[HR] If I set the SORT to Ascending, I get an error message saying I tried to execute a query that does not include the specified expression as part of an aggregate function. If I leave the TOTAL and SORT specifications empty, then the query works, but does not display in sorted order on the HR. How do I get the query to perform the divide function AND display the results sorting on the field that does the divide? Thank you. --- Allen |
#6
| |||
| |||
|
|
Did you get an answer yet? How about feeding the data into a report, which would have a textbox doing the calc yyou want.. Alan "Otie" <otie_nospam (AT) adelphia (DOT) net> wrote in message news:xpKdnU1-OeQPkQPfRVn-1g (AT) adelphia (DOT) com... I have a select query that groups records together, specifically baseball players and their home runs and at-bats. I want to create a query that displays [HR's], [AB's], and [HR's per AB's] and that sorts ASCENDING on the [HR's per AB's] field. My field is: AB_per_HR: [AB]/[HR] If I set the SORT to Ascending, I get an error message saying I tried to execute a query that does not include the specified expression as part of an aggregate function. If I leave the TOTAL and SORT specifications empty, then the query works, but does not display in sorted order on the HR. How do I get the query to perform the divide function AND display the results sorting on the field that does the divide? Thank you. --- Allen |
![]() |
| Thread Tools | |
| Display Modes | |
| |