Does not include the specified expression as part of aggregate view - What does it mean?
I used the following code which Gives me the error
"Your query does not include the specified expression 'Remaining' as part of aggregate view"
SELECT
[Insurance Policy Coverage].[Retention]-Sum([Net Invoice amount Approved]) AS Remaining,
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID]
FROM
(
[List of Law Firms] INNER JOIN
(
(
[Database] INNER JOIN [Invoice Entries] ON
Database.[Short Name] = [Invoice Entries].[Short Name]
)
INNER JOIN [Invoice Payment Processing] ON
Database.[Short Name] = [Invoice Payment Processing].[Short Name]
)
ON
([List of Law Firms].[Law Firm] = [Invoice Entries].Vendor) AND
([List of Law Firms].[Law Firm] = Database.[Law Firm].Value)
)
INNER JOIN
(
[Insurance Policy Coverage] INNER JOIN [Vendor Matter Detail] ON
([Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]) AND
([Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]) AND
([Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID])
)
ON
(Database.[Short Name] = [Vendor Matter Detail].[Short Name]) AND
(Database.[Short Name] = [Vendor Matter Detail].[Short Name])
GROUP BY
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID];
However, I use a similar code for a simple mock database it works just fine -
SELECT
[Insurance Coverage].[Retention Unit]-Sum([Net Invoice Amount]) AS Remaining,
[Matter Detail].[Claim Number],
[Insurance Coverage].[Retention Unit],
[Matter Detail].Policy
FROM
(
(
[Main Database] INNER JOIN [Matter Detail]
ON [Main Database].[Database ID] = [Matter Detail].[Short Name]
)
INNER JOIN [Payment Processing] ON
([Main Database].[Database ID] = [Payment Processing].[Short Name]) AND
([Matter Detail].[Matter Detail ID] = [Payment Processing].[Matter Detail ID])
)
INNER JOIN [Insurance Coverage] ON
[Matter Detail].Policy = [Insurance Coverage].[Insurance ID]
GROUP BY
[Matter Detail].[Claim Number],
[Insurance Coverage].[Retention Unit],
[Matter Detail].Policy;
I am new to Microsoft Access - I have read several FAQ and the common conclusion was All fields in the SELECT
field list must either be included in the GROUP BY
clause or be included as arguments to an SQL aggregate function.
But, For me it seems like there is some other error; please advise the possible reasons for such error.
I appreciate your time and thank you in advance; let me know if you need additional information.
sql ms-access
add a comment |
I used the following code which Gives me the error
"Your query does not include the specified expression 'Remaining' as part of aggregate view"
SELECT
[Insurance Policy Coverage].[Retention]-Sum([Net Invoice amount Approved]) AS Remaining,
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID]
FROM
(
[List of Law Firms] INNER JOIN
(
(
[Database] INNER JOIN [Invoice Entries] ON
Database.[Short Name] = [Invoice Entries].[Short Name]
)
INNER JOIN [Invoice Payment Processing] ON
Database.[Short Name] = [Invoice Payment Processing].[Short Name]
)
ON
([List of Law Firms].[Law Firm] = [Invoice Entries].Vendor) AND
([List of Law Firms].[Law Firm] = Database.[Law Firm].Value)
)
INNER JOIN
(
[Insurance Policy Coverage] INNER JOIN [Vendor Matter Detail] ON
([Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]) AND
([Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]) AND
([Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID])
)
ON
(Database.[Short Name] = [Vendor Matter Detail].[Short Name]) AND
(Database.[Short Name] = [Vendor Matter Detail].[Short Name])
GROUP BY
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID];
However, I use a similar code for a simple mock database it works just fine -
SELECT
[Insurance Coverage].[Retention Unit]-Sum([Net Invoice Amount]) AS Remaining,
[Matter Detail].[Claim Number],
[Insurance Coverage].[Retention Unit],
[Matter Detail].Policy
FROM
(
(
[Main Database] INNER JOIN [Matter Detail]
ON [Main Database].[Database ID] = [Matter Detail].[Short Name]
)
INNER JOIN [Payment Processing] ON
([Main Database].[Database ID] = [Payment Processing].[Short Name]) AND
([Matter Detail].[Matter Detail ID] = [Payment Processing].[Matter Detail ID])
)
INNER JOIN [Insurance Coverage] ON
[Matter Detail].Policy = [Insurance Coverage].[Insurance ID]
GROUP BY
[Matter Detail].[Claim Number],
[Insurance Coverage].[Retention Unit],
[Matter Detail].Policy;
I am new to Microsoft Access - I have read several FAQ and the common conclusion was All fields in the SELECT
field list must either be included in the GROUP BY
clause or be included as arguments to an SQL aggregate function.
But, For me it seems like there is some other error; please advise the possible reasons for such error.
I appreciate your time and thank you in advance; let me know if you need additional information.
sql ms-access
add a comment |
I used the following code which Gives me the error
"Your query does not include the specified expression 'Remaining' as part of aggregate view"
SELECT
[Insurance Policy Coverage].[Retention]-Sum([Net Invoice amount Approved]) AS Remaining,
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID]
FROM
(
[List of Law Firms] INNER JOIN
(
(
[Database] INNER JOIN [Invoice Entries] ON
Database.[Short Name] = [Invoice Entries].[Short Name]
)
INNER JOIN [Invoice Payment Processing] ON
Database.[Short Name] = [Invoice Payment Processing].[Short Name]
)
ON
([List of Law Firms].[Law Firm] = [Invoice Entries].Vendor) AND
([List of Law Firms].[Law Firm] = Database.[Law Firm].Value)
)
INNER JOIN
(
[Insurance Policy Coverage] INNER JOIN [Vendor Matter Detail] ON
([Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]) AND
([Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]) AND
([Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID])
)
ON
(Database.[Short Name] = [Vendor Matter Detail].[Short Name]) AND
(Database.[Short Name] = [Vendor Matter Detail].[Short Name])
GROUP BY
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID];
However, I use a similar code for a simple mock database it works just fine -
SELECT
[Insurance Coverage].[Retention Unit]-Sum([Net Invoice Amount]) AS Remaining,
[Matter Detail].[Claim Number],
[Insurance Coverage].[Retention Unit],
[Matter Detail].Policy
FROM
(
(
[Main Database] INNER JOIN [Matter Detail]
ON [Main Database].[Database ID] = [Matter Detail].[Short Name]
)
INNER JOIN [Payment Processing] ON
([Main Database].[Database ID] = [Payment Processing].[Short Name]) AND
([Matter Detail].[Matter Detail ID] = [Payment Processing].[Matter Detail ID])
)
INNER JOIN [Insurance Coverage] ON
[Matter Detail].Policy = [Insurance Coverage].[Insurance ID]
GROUP BY
[Matter Detail].[Claim Number],
[Insurance Coverage].[Retention Unit],
[Matter Detail].Policy;
I am new to Microsoft Access - I have read several FAQ and the common conclusion was All fields in the SELECT
field list must either be included in the GROUP BY
clause or be included as arguments to an SQL aggregate function.
But, For me it seems like there is some other error; please advise the possible reasons for such error.
I appreciate your time and thank you in advance; let me know if you need additional information.
sql ms-access
I used the following code which Gives me the error
"Your query does not include the specified expression 'Remaining' as part of aggregate view"
SELECT
[Insurance Policy Coverage].[Retention]-Sum([Net Invoice amount Approved]) AS Remaining,
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID]
FROM
(
[List of Law Firms] INNER JOIN
(
(
[Database] INNER JOIN [Invoice Entries] ON
Database.[Short Name] = [Invoice Entries].[Short Name]
)
INNER JOIN [Invoice Payment Processing] ON
Database.[Short Name] = [Invoice Payment Processing].[Short Name]
)
ON
([List of Law Firms].[Law Firm] = [Invoice Entries].Vendor) AND
([List of Law Firms].[Law Firm] = Database.[Law Firm].Value)
)
INNER JOIN
(
[Insurance Policy Coverage] INNER JOIN [Vendor Matter Detail] ON
([Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]) AND
([Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]) AND
([Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID])
)
ON
(Database.[Short Name] = [Vendor Matter Detail].[Short Name]) AND
(Database.[Short Name] = [Vendor Matter Detail].[Short Name])
GROUP BY
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID];
However, I use a similar code for a simple mock database it works just fine -
SELECT
[Insurance Coverage].[Retention Unit]-Sum([Net Invoice Amount]) AS Remaining,
[Matter Detail].[Claim Number],
[Insurance Coverage].[Retention Unit],
[Matter Detail].Policy
FROM
(
(
[Main Database] INNER JOIN [Matter Detail]
ON [Main Database].[Database ID] = [Matter Detail].[Short Name]
)
INNER JOIN [Payment Processing] ON
([Main Database].[Database ID] = [Payment Processing].[Short Name]) AND
([Matter Detail].[Matter Detail ID] = [Payment Processing].[Matter Detail ID])
)
INNER JOIN [Insurance Coverage] ON
[Matter Detail].Policy = [Insurance Coverage].[Insurance ID]
GROUP BY
[Matter Detail].[Claim Number],
[Insurance Coverage].[Retention Unit],
[Matter Detail].Policy;
I am new to Microsoft Access - I have read several FAQ and the common conclusion was All fields in the SELECT
field list must either be included in the GROUP BY
clause or be included as arguments to an SQL aggregate function.
But, For me it seems like there is some other error; please advise the possible reasons for such error.
I appreciate your time and thank you in advance; let me know if you need additional information.
sql ms-access
sql ms-access
edited Nov 19 '18 at 18:59


Lee Mac
3,60631339
3,60631339
asked Nov 19 '18 at 18:00
Ankita ZaveriAnkita Zaveri
385
385
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Problem Solved -
One of the reason why My code was throwing the error was because of the unnecessary and complex relationships between tables. The Error stopped after I removed the unnecessarily links between the table - Here is the Final code I used
SELECT [Insurance Policy Coverage].Retention-Sum([Net Invoice amount Approved]) AS Remaining,
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID]
FROM
(
[Insurance Policy Coverage] INNER JOIN [Vendor Matter Detail]
ON [Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]
)
INNER JOIN
(
([Database] INNER JOIN [Invoice Entries]
ON Database.[Short Name] = [Invoice Entries].[Short Name]
)
INNER JOIN [Invoice Payment Processing]
ON [Invoice Entries].[Invoice Entry ID] = [Invoice Payment Processing].[Invoice Entries ID]
)
ON [Vendor Matter Detail].[Vendor Matter ID] = [Invoice Entries].[Vendor Matter ID]
GROUP BY [Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID];
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53380262%2fdoes-not-include-the-specified-expression-as-part-of-aggregate-view-what-does%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Problem Solved -
One of the reason why My code was throwing the error was because of the unnecessary and complex relationships between tables. The Error stopped after I removed the unnecessarily links between the table - Here is the Final code I used
SELECT [Insurance Policy Coverage].Retention-Sum([Net Invoice amount Approved]) AS Remaining,
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID]
FROM
(
[Insurance Policy Coverage] INNER JOIN [Vendor Matter Detail]
ON [Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]
)
INNER JOIN
(
([Database] INNER JOIN [Invoice Entries]
ON Database.[Short Name] = [Invoice Entries].[Short Name]
)
INNER JOIN [Invoice Payment Processing]
ON [Invoice Entries].[Invoice Entry ID] = [Invoice Payment Processing].[Invoice Entries ID]
)
ON [Vendor Matter Detail].[Vendor Matter ID] = [Invoice Entries].[Vendor Matter ID]
GROUP BY [Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID];
add a comment |
Problem Solved -
One of the reason why My code was throwing the error was because of the unnecessary and complex relationships between tables. The Error stopped after I removed the unnecessarily links between the table - Here is the Final code I used
SELECT [Insurance Policy Coverage].Retention-Sum([Net Invoice amount Approved]) AS Remaining,
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID]
FROM
(
[Insurance Policy Coverage] INNER JOIN [Vendor Matter Detail]
ON [Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]
)
INNER JOIN
(
([Database] INNER JOIN [Invoice Entries]
ON Database.[Short Name] = [Invoice Entries].[Short Name]
)
INNER JOIN [Invoice Payment Processing]
ON [Invoice Entries].[Invoice Entry ID] = [Invoice Payment Processing].[Invoice Entries ID]
)
ON [Vendor Matter Detail].[Vendor Matter ID] = [Invoice Entries].[Vendor Matter ID]
GROUP BY [Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID];
add a comment |
Problem Solved -
One of the reason why My code was throwing the error was because of the unnecessary and complex relationships between tables. The Error stopped after I removed the unnecessarily links between the table - Here is the Final code I used
SELECT [Insurance Policy Coverage].Retention-Sum([Net Invoice amount Approved]) AS Remaining,
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID]
FROM
(
[Insurance Policy Coverage] INNER JOIN [Vendor Matter Detail]
ON [Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]
)
INNER JOIN
(
([Database] INNER JOIN [Invoice Entries]
ON Database.[Short Name] = [Invoice Entries].[Short Name]
)
INNER JOIN [Invoice Payment Processing]
ON [Invoice Entries].[Invoice Entry ID] = [Invoice Payment Processing].[Invoice Entries ID]
)
ON [Vendor Matter Detail].[Vendor Matter ID] = [Invoice Entries].[Vendor Matter ID]
GROUP BY [Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID];
Problem Solved -
One of the reason why My code was throwing the error was because of the unnecessary and complex relationships between tables. The Error stopped after I removed the unnecessarily links between the table - Here is the Final code I used
SELECT [Insurance Policy Coverage].Retention-Sum([Net Invoice amount Approved]) AS Remaining,
[Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID]
FROM
(
[Insurance Policy Coverage] INNER JOIN [Vendor Matter Detail]
ON [Insurance Policy Coverage].[Insurance Policy ID] = [Vendor Matter Detail].[Insurance Policy Coverage ID]
)
INNER JOIN
(
([Database] INNER JOIN [Invoice Entries]
ON Database.[Short Name] = [Invoice Entries].[Short Name]
)
INNER JOIN [Invoice Payment Processing]
ON [Invoice Entries].[Invoice Entry ID] = [Invoice Payment Processing].[Invoice Entries ID]
)
ON [Vendor Matter Detail].[Vendor Matter ID] = [Invoice Entries].[Vendor Matter ID]
GROUP BY [Vendor Matter Detail].[Chubb Claim number],
[Insurance Policy Coverage].Retention,
[Vendor Matter Detail].[Insurance Policy Coverage ID];
answered Nov 19 '18 at 21:13
Ankita ZaveriAnkita Zaveri
385
385
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53380262%2fdoes-not-include-the-specified-expression-as-part-of-aggregate-view-what-does%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown