To count total by current year and current month you need to execute the following MySQL statement:
Select * from tablename where year(columnname)=year(now()) and month(columnname)=month(now())
Example: Suppose we have a database product having table sale. We have to find out the sale of current month and year. To perform this you need to execute the following MySQL statement:
Select * from product where year(saledate)=year(now()) and month(saledate)=month(now());
0 Comment(s)