I am unable to use group by in nested query of ms access












-1















I am facing problem in using nested queries in MS access. Those queries are working fine in sql developer.



Access SQL:-



select 
B.prDate,
B.Month,
(select C.Entity_Id,avg(C.prclose)
from **B** as C
where C.Month>=B.Month
and C.Month <= B.Month+3
group by C.Entity_Id)
from (
select A.Entity_Id, A.prDate, A.prclose ,
(
(SELECT max(ID)
FROM sheet1 where Entity_Id=A.Entity_Id
) -
(SELECT ID
FROM sheet1 where ID=A.Id) +1
) as Month
from sheet1 as A
order by Month, A.Entity_Id asc
) B


Or



you can replace above alias with below query



select B.prDate, B.Month , ((select C.Entity_Id,avg(C.prclose) from 
(select A.Entity_Id,A.prDate,A.prclose , ((SELECT max(ID) FROM sheet1 where Entity_Id=A.Entity_Id ) - (SELECT ID FROM sheet1 where ID=A.Id ) +1) as Month from sheet1 as A order by Month, A.Entity_Id asc) B as C where C.Month>=B.Month and C.Month <= B.Month+3 group by C.Entity_Id ))

from

(select A.Entity_Id,A.prDate,A.prclose , ((SELECT max(ID) FROM sheet1 where Entity_Id=A.Entity_Id ) - (SELECT ID FROM sheet1 where ID=A.Id ) +1) as Month from sheet1 as A order by Month, A.Entity_Id asc) B


Other SQL:-



select B.prDate, B.Month , (select C.Entity_Id,avg(C.prclose) from B) as C where C.Month>=B.Month and  C.Month <= B.Month+3 group by C.Entity_Id   from  
(select A.Entity_Id,A.prDate,A.prclose , ((SELECT max(ID) FROM sheet1 where Entity_Id=A.Entity_Id ) - (SELECT ID FROM sheet1 where ID=A.Id ) +1) as Month from sheet1 as A order by Month, A.Entity_Id asc) B









share|improve this question

























  • Which are working and which are not working? How are they not working -- are you getting different results? Are you getting an error message? We need more details -- as it stands this is a statement with some facts -- we need them all to solve.

    – Hogan
    Jan 3 at 17:19











  • I also formatted the first as an example of how to format to make your code readable -- do you see how this is clearer? When sharing with others this makes a big difference.

    – Hogan
    Jan 3 at 17:25











  • After formatting I can see the line order by Month, A.Entity_Id asc has no logical value. I'd suggest removing that line.

    – Hogan
    Jan 3 at 17:26











  • Order by I had used to see data in proper order only I will remove it. I had made above queries to access same resultset but got failed

    – Dhananjay Mittal
    Jan 4 at 3:12
















-1















I am facing problem in using nested queries in MS access. Those queries are working fine in sql developer.



Access SQL:-



select 
B.prDate,
B.Month,
(select C.Entity_Id,avg(C.prclose)
from **B** as C
where C.Month>=B.Month
and C.Month <= B.Month+3
group by C.Entity_Id)
from (
select A.Entity_Id, A.prDate, A.prclose ,
(
(SELECT max(ID)
FROM sheet1 where Entity_Id=A.Entity_Id
) -
(SELECT ID
FROM sheet1 where ID=A.Id) +1
) as Month
from sheet1 as A
order by Month, A.Entity_Id asc
) B


Or



you can replace above alias with below query



select B.prDate, B.Month , ((select C.Entity_Id,avg(C.prclose) from 
(select A.Entity_Id,A.prDate,A.prclose , ((SELECT max(ID) FROM sheet1 where Entity_Id=A.Entity_Id ) - (SELECT ID FROM sheet1 where ID=A.Id ) +1) as Month from sheet1 as A order by Month, A.Entity_Id asc) B as C where C.Month>=B.Month and C.Month <= B.Month+3 group by C.Entity_Id ))

from

(select A.Entity_Id,A.prDate,A.prclose , ((SELECT max(ID) FROM sheet1 where Entity_Id=A.Entity_Id ) - (SELECT ID FROM sheet1 where ID=A.Id ) +1) as Month from sheet1 as A order by Month, A.Entity_Id asc) B


Other SQL:-



select B.prDate, B.Month , (select C.Entity_Id,avg(C.prclose) from B) as C where C.Month>=B.Month and  C.Month <= B.Month+3 group by C.Entity_Id   from  
(select A.Entity_Id,A.prDate,A.prclose , ((SELECT max(ID) FROM sheet1 where Entity_Id=A.Entity_Id ) - (SELECT ID FROM sheet1 where ID=A.Id ) +1) as Month from sheet1 as A order by Month, A.Entity_Id asc) B









share|improve this question

























  • Which are working and which are not working? How are they not working -- are you getting different results? Are you getting an error message? We need more details -- as it stands this is a statement with some facts -- we need them all to solve.

    – Hogan
    Jan 3 at 17:19











  • I also formatted the first as an example of how to format to make your code readable -- do you see how this is clearer? When sharing with others this makes a big difference.

    – Hogan
    Jan 3 at 17:25











  • After formatting I can see the line order by Month, A.Entity_Id asc has no logical value. I'd suggest removing that line.

    – Hogan
    Jan 3 at 17:26











  • Order by I had used to see data in proper order only I will remove it. I had made above queries to access same resultset but got failed

    – Dhananjay Mittal
    Jan 4 at 3:12














-1












-1








-1








I am facing problem in using nested queries in MS access. Those queries are working fine in sql developer.



Access SQL:-



select 
B.prDate,
B.Month,
(select C.Entity_Id,avg(C.prclose)
from **B** as C
where C.Month>=B.Month
and C.Month <= B.Month+3
group by C.Entity_Id)
from (
select A.Entity_Id, A.prDate, A.prclose ,
(
(SELECT max(ID)
FROM sheet1 where Entity_Id=A.Entity_Id
) -
(SELECT ID
FROM sheet1 where ID=A.Id) +1
) as Month
from sheet1 as A
order by Month, A.Entity_Id asc
) B


Or



you can replace above alias with below query



select B.prDate, B.Month , ((select C.Entity_Id,avg(C.prclose) from 
(select A.Entity_Id,A.prDate,A.prclose , ((SELECT max(ID) FROM sheet1 where Entity_Id=A.Entity_Id ) - (SELECT ID FROM sheet1 where ID=A.Id ) +1) as Month from sheet1 as A order by Month, A.Entity_Id asc) B as C where C.Month>=B.Month and C.Month <= B.Month+3 group by C.Entity_Id ))

from

(select A.Entity_Id,A.prDate,A.prclose , ((SELECT max(ID) FROM sheet1 where Entity_Id=A.Entity_Id ) - (SELECT ID FROM sheet1 where ID=A.Id ) +1) as Month from sheet1 as A order by Month, A.Entity_Id asc) B


Other SQL:-



select B.prDate, B.Month , (select C.Entity_Id,avg(C.prclose) from B) as C where C.Month>=B.Month and  C.Month <= B.Month+3 group by C.Entity_Id   from  
(select A.Entity_Id,A.prDate,A.prclose , ((SELECT max(ID) FROM sheet1 where Entity_Id=A.Entity_Id ) - (SELECT ID FROM sheet1 where ID=A.Id ) +1) as Month from sheet1 as A order by Month, A.Entity_Id asc) B









share|improve this question
















I am facing problem in using nested queries in MS access. Those queries are working fine in sql developer.



Access SQL:-



select 
B.prDate,
B.Month,
(select C.Entity_Id,avg(C.prclose)
from **B** as C
where C.Month>=B.Month
and C.Month <= B.Month+3
group by C.Entity_Id)
from (
select A.Entity_Id, A.prDate, A.prclose ,
(
(SELECT max(ID)
FROM sheet1 where Entity_Id=A.Entity_Id
) -
(SELECT ID
FROM sheet1 where ID=A.Id) +1
) as Month
from sheet1 as A
order by Month, A.Entity_Id asc
) B


Or



you can replace above alias with below query



select B.prDate, B.Month , ((select C.Entity_Id,avg(C.prclose) from 
(select A.Entity_Id,A.prDate,A.prclose , ((SELECT max(ID) FROM sheet1 where Entity_Id=A.Entity_Id ) - (SELECT ID FROM sheet1 where ID=A.Id ) +1) as Month from sheet1 as A order by Month, A.Entity_Id asc) B as C where C.Month>=B.Month and C.Month <= B.Month+3 group by C.Entity_Id ))

from

(select A.Entity_Id,A.prDate,A.prclose , ((SELECT max(ID) FROM sheet1 where Entity_Id=A.Entity_Id ) - (SELECT ID FROM sheet1 where ID=A.Id ) +1) as Month from sheet1 as A order by Month, A.Entity_Id asc) B


Other SQL:-



select B.prDate, B.Month , (select C.Entity_Id,avg(C.prclose) from B) as C where C.Month>=B.Month and  C.Month <= B.Month+3 group by C.Entity_Id   from  
(select A.Entity_Id,A.prDate,A.prclose , ((SELECT max(ID) FROM sheet1 where Entity_Id=A.Entity_Id ) - (SELECT ID FROM sheet1 where ID=A.Id ) +1) as Month from sheet1 as A order by Month, A.Entity_Id asc) B






sql ms-access






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 19:48









Parfait

53.7k94772




53.7k94772










asked Jan 3 at 17:10









Dhananjay MittalDhananjay Mittal

1




1













  • Which are working and which are not working? How are they not working -- are you getting different results? Are you getting an error message? We need more details -- as it stands this is a statement with some facts -- we need them all to solve.

    – Hogan
    Jan 3 at 17:19











  • I also formatted the first as an example of how to format to make your code readable -- do you see how this is clearer? When sharing with others this makes a big difference.

    – Hogan
    Jan 3 at 17:25











  • After formatting I can see the line order by Month, A.Entity_Id asc has no logical value. I'd suggest removing that line.

    – Hogan
    Jan 3 at 17:26











  • Order by I had used to see data in proper order only I will remove it. I had made above queries to access same resultset but got failed

    – Dhananjay Mittal
    Jan 4 at 3:12



















  • Which are working and which are not working? How are they not working -- are you getting different results? Are you getting an error message? We need more details -- as it stands this is a statement with some facts -- we need them all to solve.

    – Hogan
    Jan 3 at 17:19











  • I also formatted the first as an example of how to format to make your code readable -- do you see how this is clearer? When sharing with others this makes a big difference.

    – Hogan
    Jan 3 at 17:25











  • After formatting I can see the line order by Month, A.Entity_Id asc has no logical value. I'd suggest removing that line.

    – Hogan
    Jan 3 at 17:26











  • Order by I had used to see data in proper order only I will remove it. I had made above queries to access same resultset but got failed

    – Dhananjay Mittal
    Jan 4 at 3:12

















Which are working and which are not working? How are they not working -- are you getting different results? Are you getting an error message? We need more details -- as it stands this is a statement with some facts -- we need them all to solve.

– Hogan
Jan 3 at 17:19





Which are working and which are not working? How are they not working -- are you getting different results? Are you getting an error message? We need more details -- as it stands this is a statement with some facts -- we need them all to solve.

– Hogan
Jan 3 at 17:19













I also formatted the first as an example of how to format to make your code readable -- do you see how this is clearer? When sharing with others this makes a big difference.

– Hogan
Jan 3 at 17:25





I also formatted the first as an example of how to format to make your code readable -- do you see how this is clearer? When sharing with others this makes a big difference.

– Hogan
Jan 3 at 17:25













After formatting I can see the line order by Month, A.Entity_Id asc has no logical value. I'd suggest removing that line.

– Hogan
Jan 3 at 17:26





After formatting I can see the line order by Month, A.Entity_Id asc has no logical value. I'd suggest removing that line.

– Hogan
Jan 3 at 17:26













Order by I had used to see data in proper order only I will remove it. I had made above queries to access same resultset but got failed

– Dhananjay Mittal
Jan 4 at 3:12





Order by I had used to see data in proper order only I will remove it. I had made above queries to access same resultset but got failed

– Dhananjay Mittal
Jan 4 at 3:12












1 Answer
1






active

oldest

votes


















0














In SELECT clause subqueries, you cannot return more than one field as you attempt with aggregate query. To resolve, because you need to reuse B, consider saving this resultset in an intermediate, external query and reference it in a final query:



Intermediate Query (save as MS Access query object; last nested SELECT is redundant)



SELECT A.Entity_Id, A.prDate, A.prclose, 
((SELECT MAX(sub.ID)
FROM sheet1 sub
WHERE sub.Entity_Id = A.Entity_Id) - sub.ID) + 1 AS [Month]
FROM sheet1 as A


Final Query



SELECT q.Entity_Id, q.prDate, q.[Month],
(SELECT AVG(sub_q.prclose)
FROM mySavedQuery AS sub_q
WHERE sub_q.Entity_Id = q.Entity_Id
AND sub_q.[Month] >= q.[Month]
AND sub_q.[Month] <= q.[Month] + 3
) AS Avg_PrClose
FROM mySavedQuery AS q
ORDER BY q.[Month], q.Entity_Id




When the day comes when MS Access SQL supports CTE (or you upsize to an enterprise RDBMS), you can turn the saved query object into WITH clause for one statement:



WITH mySavedQuery AS
(SELECT A.Entity_Id, A.prDate, A.prclose,
((SELECT MAX(sub.ID)
FROM sheet1 sub
WHERE sub.Entity_Id = A.Entity_Id) - sub.ID) + 1 AS [Month]
FROM sheet1 as A)

SELECT q.Entity_Id, q.prDate, q.[Month],
(SELECT AVG(sub_q.prclose)
FROM mySavedQuery AS sub_q
WHERE sub_q.Entity_Id = q.Entity_Id
AND sub_q.[Month] >= q.[Month]
AND sub_q.[Month] <= q.[Month] + 3
) AS Avg_PrClose
FROM mySavedQuery AS q
ORDER BY q.[Month], q.Entity_Id





share|improve this answer


























  • agg_q.[Month] object is not avaialble in the agg_q

    – Dhananjay Mittal
    Jan 4 at 8:22











  • See edit. You will need a correlated subquery (not as efficient as JOIN) for the rolling windows by Month.

    – Parfait
    Jan 4 at 14:48












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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54026796%2fi-am-unable-to-use-group-by-in-nested-query-of-ms-access%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









0














In SELECT clause subqueries, you cannot return more than one field as you attempt with aggregate query. To resolve, because you need to reuse B, consider saving this resultset in an intermediate, external query and reference it in a final query:



Intermediate Query (save as MS Access query object; last nested SELECT is redundant)



SELECT A.Entity_Id, A.prDate, A.prclose, 
((SELECT MAX(sub.ID)
FROM sheet1 sub
WHERE sub.Entity_Id = A.Entity_Id) - sub.ID) + 1 AS [Month]
FROM sheet1 as A


Final Query



SELECT q.Entity_Id, q.prDate, q.[Month],
(SELECT AVG(sub_q.prclose)
FROM mySavedQuery AS sub_q
WHERE sub_q.Entity_Id = q.Entity_Id
AND sub_q.[Month] >= q.[Month]
AND sub_q.[Month] <= q.[Month] + 3
) AS Avg_PrClose
FROM mySavedQuery AS q
ORDER BY q.[Month], q.Entity_Id




When the day comes when MS Access SQL supports CTE (or you upsize to an enterprise RDBMS), you can turn the saved query object into WITH clause for one statement:



WITH mySavedQuery AS
(SELECT A.Entity_Id, A.prDate, A.prclose,
((SELECT MAX(sub.ID)
FROM sheet1 sub
WHERE sub.Entity_Id = A.Entity_Id) - sub.ID) + 1 AS [Month]
FROM sheet1 as A)

SELECT q.Entity_Id, q.prDate, q.[Month],
(SELECT AVG(sub_q.prclose)
FROM mySavedQuery AS sub_q
WHERE sub_q.Entity_Id = q.Entity_Id
AND sub_q.[Month] >= q.[Month]
AND sub_q.[Month] <= q.[Month] + 3
) AS Avg_PrClose
FROM mySavedQuery AS q
ORDER BY q.[Month], q.Entity_Id





share|improve this answer


























  • agg_q.[Month] object is not avaialble in the agg_q

    – Dhananjay Mittal
    Jan 4 at 8:22











  • See edit. You will need a correlated subquery (not as efficient as JOIN) for the rolling windows by Month.

    – Parfait
    Jan 4 at 14:48
















0














In SELECT clause subqueries, you cannot return more than one field as you attempt with aggregate query. To resolve, because you need to reuse B, consider saving this resultset in an intermediate, external query and reference it in a final query:



Intermediate Query (save as MS Access query object; last nested SELECT is redundant)



SELECT A.Entity_Id, A.prDate, A.prclose, 
((SELECT MAX(sub.ID)
FROM sheet1 sub
WHERE sub.Entity_Id = A.Entity_Id) - sub.ID) + 1 AS [Month]
FROM sheet1 as A


Final Query



SELECT q.Entity_Id, q.prDate, q.[Month],
(SELECT AVG(sub_q.prclose)
FROM mySavedQuery AS sub_q
WHERE sub_q.Entity_Id = q.Entity_Id
AND sub_q.[Month] >= q.[Month]
AND sub_q.[Month] <= q.[Month] + 3
) AS Avg_PrClose
FROM mySavedQuery AS q
ORDER BY q.[Month], q.Entity_Id




When the day comes when MS Access SQL supports CTE (or you upsize to an enterprise RDBMS), you can turn the saved query object into WITH clause for one statement:



WITH mySavedQuery AS
(SELECT A.Entity_Id, A.prDate, A.prclose,
((SELECT MAX(sub.ID)
FROM sheet1 sub
WHERE sub.Entity_Id = A.Entity_Id) - sub.ID) + 1 AS [Month]
FROM sheet1 as A)

SELECT q.Entity_Id, q.prDate, q.[Month],
(SELECT AVG(sub_q.prclose)
FROM mySavedQuery AS sub_q
WHERE sub_q.Entity_Id = q.Entity_Id
AND sub_q.[Month] >= q.[Month]
AND sub_q.[Month] <= q.[Month] + 3
) AS Avg_PrClose
FROM mySavedQuery AS q
ORDER BY q.[Month], q.Entity_Id





share|improve this answer


























  • agg_q.[Month] object is not avaialble in the agg_q

    – Dhananjay Mittal
    Jan 4 at 8:22











  • See edit. You will need a correlated subquery (not as efficient as JOIN) for the rolling windows by Month.

    – Parfait
    Jan 4 at 14:48














0












0








0







In SELECT clause subqueries, you cannot return more than one field as you attempt with aggregate query. To resolve, because you need to reuse B, consider saving this resultset in an intermediate, external query and reference it in a final query:



Intermediate Query (save as MS Access query object; last nested SELECT is redundant)



SELECT A.Entity_Id, A.prDate, A.prclose, 
((SELECT MAX(sub.ID)
FROM sheet1 sub
WHERE sub.Entity_Id = A.Entity_Id) - sub.ID) + 1 AS [Month]
FROM sheet1 as A


Final Query



SELECT q.Entity_Id, q.prDate, q.[Month],
(SELECT AVG(sub_q.prclose)
FROM mySavedQuery AS sub_q
WHERE sub_q.Entity_Id = q.Entity_Id
AND sub_q.[Month] >= q.[Month]
AND sub_q.[Month] <= q.[Month] + 3
) AS Avg_PrClose
FROM mySavedQuery AS q
ORDER BY q.[Month], q.Entity_Id




When the day comes when MS Access SQL supports CTE (or you upsize to an enterprise RDBMS), you can turn the saved query object into WITH clause for one statement:



WITH mySavedQuery AS
(SELECT A.Entity_Id, A.prDate, A.prclose,
((SELECT MAX(sub.ID)
FROM sheet1 sub
WHERE sub.Entity_Id = A.Entity_Id) - sub.ID) + 1 AS [Month]
FROM sheet1 as A)

SELECT q.Entity_Id, q.prDate, q.[Month],
(SELECT AVG(sub_q.prclose)
FROM mySavedQuery AS sub_q
WHERE sub_q.Entity_Id = q.Entity_Id
AND sub_q.[Month] >= q.[Month]
AND sub_q.[Month] <= q.[Month] + 3
) AS Avg_PrClose
FROM mySavedQuery AS q
ORDER BY q.[Month], q.Entity_Id





share|improve this answer















In SELECT clause subqueries, you cannot return more than one field as you attempt with aggregate query. To resolve, because you need to reuse B, consider saving this resultset in an intermediate, external query and reference it in a final query:



Intermediate Query (save as MS Access query object; last nested SELECT is redundant)



SELECT A.Entity_Id, A.prDate, A.prclose, 
((SELECT MAX(sub.ID)
FROM sheet1 sub
WHERE sub.Entity_Id = A.Entity_Id) - sub.ID) + 1 AS [Month]
FROM sheet1 as A


Final Query



SELECT q.Entity_Id, q.prDate, q.[Month],
(SELECT AVG(sub_q.prclose)
FROM mySavedQuery AS sub_q
WHERE sub_q.Entity_Id = q.Entity_Id
AND sub_q.[Month] >= q.[Month]
AND sub_q.[Month] <= q.[Month] + 3
) AS Avg_PrClose
FROM mySavedQuery AS q
ORDER BY q.[Month], q.Entity_Id




When the day comes when MS Access SQL supports CTE (or you upsize to an enterprise RDBMS), you can turn the saved query object into WITH clause for one statement:



WITH mySavedQuery AS
(SELECT A.Entity_Id, A.prDate, A.prclose,
((SELECT MAX(sub.ID)
FROM sheet1 sub
WHERE sub.Entity_Id = A.Entity_Id) - sub.ID) + 1 AS [Month]
FROM sheet1 as A)

SELECT q.Entity_Id, q.prDate, q.[Month],
(SELECT AVG(sub_q.prclose)
FROM mySavedQuery AS sub_q
WHERE sub_q.Entity_Id = q.Entity_Id
AND sub_q.[Month] >= q.[Month]
AND sub_q.[Month] <= q.[Month] + 3
) AS Avg_PrClose
FROM mySavedQuery AS q
ORDER BY q.[Month], q.Entity_Id






share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 4 at 14:47

























answered Jan 3 at 20:08









ParfaitParfait

53.7k94772




53.7k94772













  • agg_q.[Month] object is not avaialble in the agg_q

    – Dhananjay Mittal
    Jan 4 at 8:22











  • See edit. You will need a correlated subquery (not as efficient as JOIN) for the rolling windows by Month.

    – Parfait
    Jan 4 at 14:48



















  • agg_q.[Month] object is not avaialble in the agg_q

    – Dhananjay Mittal
    Jan 4 at 8:22











  • See edit. You will need a correlated subquery (not as efficient as JOIN) for the rolling windows by Month.

    – Parfait
    Jan 4 at 14:48

















agg_q.[Month] object is not avaialble in the agg_q

– Dhananjay Mittal
Jan 4 at 8:22





agg_q.[Month] object is not avaialble in the agg_q

– Dhananjay Mittal
Jan 4 at 8:22













See edit. You will need a correlated subquery (not as efficient as JOIN) for the rolling windows by Month.

– Parfait
Jan 4 at 14:48





See edit. You will need a correlated subquery (not as efficient as JOIN) for the rolling windows by Month.

– Parfait
Jan 4 at 14:48




















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54026796%2fi-am-unable-to-use-group-by-in-nested-query-of-ms-access%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas