There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.
You are using the TSQL function MONTH() on every row of data. that function returns an integer.
So I do not understand your question really.
http://en.wikipedia.org/wiki/Sargable
Rules of thumb
Avoid applying functions on data values in a sql condition.
Avoid non-sargable predicates and replace them with sargable equivalents.
You should aim to NOT ALTER the (many rows of) DATA to suit your (single) parameter, instead do the reverse.
Alter the single parameter to suit the many rows of data.
So, if your parameter is 9, you need a routine that will give you the FIRST DAY of month 10
with the only wrinkle being if the parameter is 12 you need the FIRST DAY of month 1 and the year incremented however as you don't reveal how the financial year is established this might not be a problem.
Let's illustrate this:
assuming [activitydate] is date or datetime(2)
2014-09-01 is less than 2015-10-01
...
2014-09-30 is less than 2015-10-01
so you will be accurate by using less than (the first day of the next month)