Thank you Ratslinger!
Unfortunately, being a newbie to the forum, I hit some sort of post limit so couldn’t add this.
Quick question:
I also needed to do a QUERY for the opposite infomation. Using your SQL statement as a template, I did some changes to use for the new QUERY.
This WAS the code I tried, which error’ed out:
SELECT
“clients”.“client_name” AS “client”,
“acctg_categories”.“category”,
SUM( “accounts_receivable”.“amount” ) AS “amount”
FROM “accounts_receivable”, “clients”, “acctg_categories”
WHERE
“accounts_receivable”.“clientID” = “clients”.“clientID”
AND “accounts_receivable”.“categoryID” = “acctg_categories”.“categoryID”
AND “accounts_receivable”.“Date” BETWEEN :Enter_Begin_Date AND :Enter_End_Date
AND “acctg_categories”.“categoryID” BETWEEN 1 AND 36
GROUP BY “clients”.“client_name”
ORDER BY “clients”.“client” ASC
On a fluke, I changed this line in the GROUP BY with the following; no other changes:
GROUP BY "clients"."client_name", "acctg_categories"."category"
And it worked.
My question is, why did I need to add a second GROUP BY criterion to the SQL code for this to work? I personally didn’t need a secondary GROUP BY in my results.
Thank you.