I think you will need two (sub)queries: one to sum over the rows where Bank2014>=1/1/14 and one to sum over the rows where Bank2015<1/1/15:
- Code: Select all Expand viewCollapse view
SELECT "A"."2014_Subs" + "B"."2015_Subs" AS "2014_Banked_Subs"
FROM (SELECT SUM("Amt2014") AS "2014_Subs" FROM "YourTableName" WHERE "Bank2014" >= '2014-01-01') "A",
(SELECT SUM("Amt2015") AS "2015_Subs" FROM "YourTableName" WHERE "Bank2015" < '2015-01-01') "B"
Not really that simple. This would be much easier if you stored your membership dues in rows, in a separate table, instead of in columns in your main table. For example, you could have the following tables where TABLE NAME is in all caps and column names for each table are listed under the name:
MEMBERS
MemberID (primary key)
MemberName
MemberAddress
[Other member identifying information]
SUBSCRIPTIONS
SubID (primary key)
MemberID (foreign key - meaning, it matches a primary key from the MEMBERS table)
SubYear
PaymentDate
AmountPaid
Now, if your database was set up like that, your query would be:
- Code: Select all Expand viewCollapse view
SELECT SUM("AmountPaid")
FROM "SUBSCRIPTIONS"
WHERE "PaymentDate" >= '2014-01-01' AND "PaymentDate" < '2015-01-01'
Much simpler, yes?