A family of Microsoft relational database management systems designed for ease of use.
I will carry on with sweating over it. If a solution pans out, I will let you know. Thank you.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello! Please help me out with the following below SQL:
The error I get says: "Your query does not include the specified expression 'Order' as part of an aggregate function." Would you please tell me what exactly I am missing on/after FROM? Thank you. Daler
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
I will carry on with sweating over it. If a solution pans out, I will let you know. Thank you.
We can't answer that without knowing what the fields are. In a Group By query, you have to Group By the field(s) that cover the aggregate function. For example. if you have an extended price for each line item in an Order, and you want to sum the extended price for all line items in the order, then you would do something like this:
SELECT OrderID, Sum(ExtendedPrice) AS TotalPrice
FROM OrderDetails
Group By OrderID;
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
The part
Sum([Dst_Congressional]+[Dst_
appears to be incomplete: the closing square bracket ] and closing parenthesis ) are missing.
Apart from that, a query involving Sum(...) is a totals query. Any column not using Sum, Count, Avg or similar must be listed in the GROUP BY clause, but your query doesn't have one.
Hi Daler, I'm an independent adviser and will try to help.
There are two issues I see. First, the word Order is a keyword in Access and shouldn't be used as an object name. Second, You are using aggregate functions (SUM()) but you aren't using a Group By. That is probably the main reason.
Its not 100% clear what you are trying to do here. Also there seems to be a part of the SQL statement missing before the FROM clause.
If you need further clarification on this feel free to ask. But it would help if you explained what you are trying to do with this query.