When I do groupby gl_acct, the following error shows up.
Can anyone find out why? Thanks.
You tried to execute a query that does not include the specified expression
'gl_acct' as part of an aggregate function.
SELECT IFS_gl_balance.gl_acct, IFS_gl_master.gl_abbrev_desc, (SELECT Sum(IFS_gl_balance.gl_balance_amt)
FROM IFS_gl_balance as IFS_gl_balance1, IFS_fd_master as IFS_fd_master1
WHERE IFS_gl_balance1.gl_id = IFS_gl_balance.gl_id
AND IFS_gl_balance1.gl_year = 2006
AND IFS_gl_balance1.gl_period < 1
AND IFS_gl_balance1.gl_period >= 0
AND IFS_fd_master1.fd_id = IFS_gl_balance1.fd_id) AS GL_BEGBAL, (SELECT Sum(IFS_gl_balance.gl_balance_debit)
FROM IFS_gl_balance as IFS_gl_balance2, IFS_fd_master as IFS_fd_master2
WHERE IFS_gl_balance2.gl_id = IFS_gl_balance.gl_id
AND IFS_gl_balance2.gl_year = 2006
AND IFS_gl_balance2.gl_period <= 1
AND IFS_gl_balance2.gl_period >= 1
AND IFS_fd_master2.fd_id = IFS_gl_balance2.fd_id) AS GL_DEBITS, (SELECT Sum(IFS_gl_balance.gl_balance_credit)
FROM IFS_gl_balance as IFS_gl_balance3, IFS_fd_master as IFS_fd_master3
WHERE IFS_gl_balance3.gl_id = IFS_gl_balance.gl_id
AND IFS_gl_balance3.gl_year = 2006
AND IFS_gl_balance3.gl_period <= 1
AND IFS_gl_balance3.gl_period >= 1
AND IFS_fd_master3.fd_id = IFS_gl_balance3.fd_id) AS GL_CREDITS
FROM IFS_gl_master INNER JOIN (IFS_gl_balance INNER JOIN IFS_fd_master ON IFS_gl_balance.fd_id = IFS_fd_master.fd_id) ON (IFS_gl_master.fd_company = IFS_fd_master.fd_company) AND (IFS_gl_master.gl_id = IFS_gl_balance.gl_acct)
WHERE (((IFS_gl_balance.gl_year)=2006) AND ((IFS_gl_balance.gl_period)<=1))
GROUP BY IFS_gl_balance.gl_acct, IFS_gl_master.gl_abbrev_desc
HAVING (((IFS_gl_balance.gl_acct)="1000"))
ORDER BY IFS_gl_balance.gl_acct, IFS_gl_master.gl_abbrev_desc;
Can anyone find out why? Thanks.
You tried to execute a query that does not include the specified expression
'gl_acct' as part of an aggregate function.
SELECT IFS_gl_balance.gl_acct, IFS_gl_master.gl_abbrev_desc, (SELECT Sum(IFS_gl_balance.gl_balance_amt)
FROM IFS_gl_balance as IFS_gl_balance1, IFS_fd_master as IFS_fd_master1
WHERE IFS_gl_balance1.gl_id = IFS_gl_balance.gl_id
AND IFS_gl_balance1.gl_year = 2006
AND IFS_gl_balance1.gl_period < 1
AND IFS_gl_balance1.gl_period >= 0
AND IFS_fd_master1.fd_id = IFS_gl_balance1.fd_id) AS GL_BEGBAL, (SELECT Sum(IFS_gl_balance.gl_balance_debit)
FROM IFS_gl_balance as IFS_gl_balance2, IFS_fd_master as IFS_fd_master2
WHERE IFS_gl_balance2.gl_id = IFS_gl_balance.gl_id
AND IFS_gl_balance2.gl_year = 2006
AND IFS_gl_balance2.gl_period <= 1
AND IFS_gl_balance2.gl_period >= 1
AND IFS_fd_master2.fd_id = IFS_gl_balance2.fd_id) AS GL_DEBITS, (SELECT Sum(IFS_gl_balance.gl_balance_credit)
FROM IFS_gl_balance as IFS_gl_balance3, IFS_fd_master as IFS_fd_master3
WHERE IFS_gl_balance3.gl_id = IFS_gl_balance.gl_id
AND IFS_gl_balance3.gl_year = 2006
AND IFS_gl_balance3.gl_period <= 1
AND IFS_gl_balance3.gl_period >= 1
AND IFS_fd_master3.fd_id = IFS_gl_balance3.fd_id) AS GL_CREDITS
FROM IFS_gl_master INNER JOIN (IFS_gl_balance INNER JOIN IFS_fd_master ON IFS_gl_balance.fd_id = IFS_fd_master.fd_id) ON (IFS_gl_master.fd_company = IFS_fd_master.fd_company) AND (IFS_gl_master.gl_id = IFS_gl_balance.gl_acct)
WHERE (((IFS_gl_balance.gl_year)=2006) AND ((IFS_gl_balance.gl_period)<=1))
GROUP BY IFS_gl_balance.gl_acct, IFS_gl_master.gl_abbrev_desc
HAVING (((IFS_gl_balance.gl_acct)="1000"))
ORDER BY IFS_gl_balance.gl_acct, IFS_gl_master.gl_abbrev_desc;