G
Goldar
I have a table (tblBudget) that contains three fields: [GL Account],
[Sequence no] and [CY Amount]. Each [GL Account] has one header record
([Sequence no]=0) and may have many detail records ([Sequence no]=1+). The
[CY Budget] field in the header record is the sum of the [CY Budget] field in
all of the detail records. I tried to create a query to calculate the total
of each group of detail records ([Sequence no]>0), but I keep getting an
error. My query is:
SELECT tblBudget.[GL Account], Sum(tblBudget.[CY Budget]) AS [Budget]
FROM tblBudget
GROUP BY tblBudget.[GL Account]
HAVING (((tblBudget.[Sequence no])>0));
The error that I get is : "You tried to execute a query that does not
include the specified expression ('tblBudget.[Sequence no]>0' as part of an
aggregate function."
What is wrong with my query?
Thanks...
[Sequence no] and [CY Amount]. Each [GL Account] has one header record
([Sequence no]=0) and may have many detail records ([Sequence no]=1+). The
[CY Budget] field in the header record is the sum of the [CY Budget] field in
all of the detail records. I tried to create a query to calculate the total
of each group of detail records ([Sequence no]>0), but I keep getting an
error. My query is:
SELECT tblBudget.[GL Account], Sum(tblBudget.[CY Budget]) AS [Budget]
FROM tblBudget
GROUP BY tblBudget.[GL Account]
HAVING (((tblBudget.[Sequence no])>0));
The error that I get is : "You tried to execute a query that does not
include the specified expression ('tblBudget.[Sequence no]>0' as part of an
aggregate function."
What is wrong with my query?
Thanks...