Let me just give a simplified example to illustrate what I mean.
Let's say we have a table named accounts with columns deposits, dmonth, and dyear. Select sum(deposits) will get the sum of ALL values under the deposits column. What is the SQL query to get sum of deposits for, say, period earlier than July 2016