Welcome Guest, Not a member yet? Register   Sign In
Need Help for sum statement
#1

[eluser]Farzand[/eluser]
i m trying to sum two tables field.
but on view i get double record. my db table have 3 record and i to sum them but when i m going to view i get 6 record.
some one help to sum two table field?
$this->db->select("bt_tayyab_lc.id as id, sum(bt_tayyab_lc.weight) as weight,bt_tayyab_remarks.id as id, bt_tayyab_remarks.lcid as lcid");
$this->db->join('tayyab_remarks','tayyab_lc.id = tayyab_remarks.lcid' ,'left');
$this->db->where('tayyab_lc.creat_at >=', $currentdate1);
$this->db->where('tayyab_lc.creat_at <=', $currentdate);
$this->db->where('tayyab_lc.cid','1');
$data['supplier_account'] = $this->db->get('tayyab_lc');


Messages In This Thread
Need Help for sum statement - by El Forum - 03-27-2012, 11:16 AM
Need Help for sum statement - by El Forum - 03-27-2012, 11:16 AM
Need Help for sum statement - by El Forum - 03-27-2012, 12:02 PM
Need Help for sum statement - by El Forum - 03-27-2012, 12:31 PM
Need Help for sum statement - by El Forum - 03-27-2012, 12:46 PM
Need Help for sum statement - by El Forum - 03-27-2012, 12:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB