If you use a
GROUP BY clause[
^] you can partition your data into separate months.
You can then use the
aggregate function MAX[
^] to give you the highest date in each month.
Then it's a simple matter to use a
JOIN[
^] to get the row for each month that contains that date.