I am receiving “Wrong Data Type in Statement [ SELECT etc.” error message, underlying Error Code: -16 but the message doesn’t give any clues as what to be looking for. The error showed up when I included the SUM and GROUP functions. The query ran prior to that. Any direction?
The SQL is:
SELECT "PaymentHistory"."PHMemberID" AS "Badge",
"MemberMaster"."LastName" || ' ' || "MemberMaster"."FirstName" AS "Name",
"PaymentHistory"."PaymentDate",
"PaymentHistory"."CheckNumber",
SUM("PaymentHistory"."PaymentAmount"),
SUM("PaymentHistory"."Dues"),
SUM("PaymentHistory"."Astro"),
SUM("PaymentHistory"."Media"),
SUM("PaymentHistory"."Food"),
SUM("PaymentHistory"."Other")
FROM { oj "MemberMaster"
RIGHT OUTER JOIN "PaymentHistory" ON "MemberMaster"."MemberID" = "PaymentHistory"."PHMemberID" }
GROUP BY "PaymentHistory"."PHMemberID",
"PaymentHistory"."PaymentDate",
"PaymentHistory"."CheckNumber",
"MemberMaster"."LastName",
"MemberMaster"."FirstName"
HAVING ("PaymentHistory"."PaymentDate" >= :Date_Since)
ORDER BY "MemberMaster"."LastName" ASC,
"MemberMaster"."FirstName" ASC
Edited to format for readability.