hello erp system want specific type of data fetch database example if want number of row added in current month purchase use
select count(receive_no) tbl contact_id=".$contactid." , month(created_on) = month(curdate());
but gets false results , if want sum of result in current month use
select sum(price) tbl contact_id=".$contactid." , month(created_on) = month(curdate())
and if want today date number of row or purchase use
select count(receive_no) tbl contact_id=".$contactid." , created_on >= curdate()
so if want today sum of purchase use
select sum(price) tbl contact_id=".$contactid." , created_on >= curdate()
my table created on field datetime 2016-09-01 11:56:45 please suggest me better query fetch exact data thanks
it's not clear - if - problem last 3 queries, first 1 data month year and month last year, year before that, etc. etc.
so need (there several ways write that...):
select count(receive_no) tbl contact_id=".$contactid." , month(created_on) = month(curdate()) , year(created_on) = year(curdate())
Comments
Post a Comment