I am working on one erp where i want to create pdf of each month of every user.
for that i have some data in mysql. i am attaching image of my table with data.
In pdf there will some fields should be display like particular user's this years net_salary, how many days he worked for this year etc.
For that basically i have to use SUM(column_name) with some conditions, but i cant get logic that if user will have 2018's 12 months data into database but user want only october month's salary_slip.
So now i want to display his 2018's SUM(net_salary) but till october months only. November and december's data should not be there in calculation.
I dont know how to create query for this.