hope you are all well
I am struggling to write a sql code which will pick up the sales value of the last date of each month.
I have this below example table showing sales which accumulate daily for each month, the late day of the month is the final sales value ( this is just example table in reality there are much more months)
from the table I need to write a query ( select query etc) that will show the below
The past sales is the sales number of the last day of the previous month ( for this case we start at November so the past sales for November is blank, for December past sales is the value you see for 31/11/2020 ) current sales is the last day of the month in question.
Can this be done? can anyone help me do this?