You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a filter with an aggregate function is added (e.g., (SUM(\tabGL Entry.debit` - `tabGL Entry.credit`) > 0)), the generated SQL places the filter in the WHERE` clause by default:
This query results in an SQL error because aggregate functions like SUM cannot be used in the WHERE clause. Instead, they should be placed in the HAVING clause to ensure proper execution after aggregation.
Description:
When a filter with an aggregate function is added (e.g.,
(SUM(\
tabGL Entry.debit` - `tabGL Entry.credit`) > 0)), the generated SQL places the filter in the
WHERE` clause by default:This query results in an SQL error because aggregate functions like
SUM
cannot be used in theWHERE
clause. Instead, they should be placed in theHAVING
clause to ensure proper execution after aggregation.Expected SQL:
Proposed Solution:
Enhance Query Logic:
HAVING
clause.Provide User Control:
WHERE
orHAVING
clause.Steps to Reproduce:
Gl Entry
.Party
.(SUM(\
tabGL Entry.debit` - `tabGL Entry.credit`) > 0)`.WHERE
clause, causing an error.Screenshots:
The text was updated successfully, but these errors were encountered: