I am using this to get today's record.
$this->db->where('date(BaseTbl.createdDtm)', date('Y-m-d'));
How to get this month's record? Would anyone please suggest the way?
I am using this to get today's record.
$this->db->where('date(BaseTbl.createdDtm)', date('Y-m-d'));
How to get this month's record? Would anyone please suggest the way?
Using only mysql you can do it:
SELECT *
FROM table_name
WHERE YEAR(BaseTbl.createdDtm) = YEAR(CURRENT_DATE()) AND
MONTH(BaseTbl.createdDtm) = MONTH(CURRENT_DATE());
EDIT
For codeigniter
$this->db->where('YEAR(BaseTbl.createdDtm))', date('Y'));
$this->db->where('MONTH(BaseTbl.createdDtm))', date('m'));