Rumus menjumlahkan per tanggal

Mohon informasinya rumusnya cara menjumlahkan Transaksi Pertanggal, berikut ini kodenya.

";

//$sql = mysql_query("SELECT * FROM tb_detail_penjualan group by timestmp LIKE '%$_GET[bulan]%'") or die(mysql_error()); $sql = mysql_query("SELECT * FROM tb_penjualan where tgl_transaksi LIKE '%$_GET[bulan]%'") or die(mysql_error()); $no = 0; while($p = mysql_fetch_assoc($sql)) { $no++; //$sqla = mysql_fetch_array(mysql_query("SELECT SUM(qty) as qty FROM tb_penjualan group by tgl_traksasi AND timestmp LIKE '%$_GET[bulan]%'")); $sqla = mysql_fetch_array(mysql_query("SELECT SUM(qty) as qty FROM tb_detail_penjualan WHERE no_transaksi='$p[no_transaksi]' AND timestmp LIKE '%$_GET[bulan]%'")); //$tglnya = mysql_fetch_array(mysql_query("SELECT COUNT(tgl_transaksi) as count FROM tb_penjualan WHERE timestmp LIKE '%$_GET[bulan]%'"));

}

$transaksi = mysql_fetch_array(mysql_query("SELECT COUNT(no_transaksi) as count FROM tb_penjualan WHERE timestmp LIKE '%$_GET[bulan]%'")); $qty = mysql_fetch_array(mysql_query("SELECT SUM(qty) as qty FROM tb_detail_penjualan WHERE timestmp LIKE '%$_GET[bulan]%'")); $total = mysql_fetch_array(mysql_query("SELECT SUM(total_harga) as total FROM tb_penjualan WHERE metode='cash' AND timestmp LIKE '%$_GET[bulan]%'")); $transfer = mysql_fetch_array(mysql_query("SELECT SUM(total_harga) as total FROM tb_penjualan WHERE metode='transfer' AND timestmp LIKE '%$_GET[bulan]%'")); $credit = mysql_fetch_array(mysql_query("SELECT SUM(total_harga) as total FROM tb_penjualan WHERE metode='credit card' AND timestmp LIKE '%$_GET[bulan]%'")); $bca = mysql_fetch_array(mysql_query("SELECT SUM(total_harga) as total FROM tb_penjualan WHERE kartu='bca' AND timestmp LIKE '%$_GET[bulan]%'")); $mandiri = mysql_fetch_array(mysql_query("SELECT SUM(total_harga) as total FROM tb_penjualan WHERE kartu='mandiri' AND timestmp LIKE '%$_GET[bulan]%'")); $maybank = mysql_fetch_array(mysql_query("SELECT SUM(total_harga) as total FROM tb_penjualan WHERE kartu='maybank' AND timestmp LIKE '%$_GET[bulan]%'")); $citibank = mysql_fetch_array(mysql_query("SELECT SUM(total_harga) as total FROM tb_penjualan WHERE kartu='citibank' AND timestmp LIKE '%$_GET[bulan]%'")); $bni = mysql_fetch_array(mysql_query("SELECT SUM(total_harga) as total FROM tb_penjualan WHERE kartu='bni' AND timestmp LIKE '%$_GET[bulan]%'")); $mega = mysql_fetch_array(mysql_query("SELECT SUM(total_harga) as total FROM tb_penjualan WHERE kartu='mega' AND timestmp LIKE '%$_GET[bulan]%'")); $bri = mysql_fetch_array(mysql_query("SELECT SUM(total_harga) as total FROM tb_penjualan WHERE kartu='bri' AND timestmp LIKE '%$_GET[bulan]%'")); $cimbniaga = mysql_fetch_array(mysql_query("SELECT SUM(total_harga) as total FROM tb_penjualan WHERE kartu='cimb niaga' AND timestmp LIKE '%$_GET[bulan]%'"));

echo""; echo""; ?> Total Golf CartTotal Transaksi - CashTotal Transaksi - TransferTotal Transaksi - Credit CardCredit Card - BCACredit Card - MandiriCredit Card - MayBankCredit Card - BRIGrand Total Transaksi**".$qty['qty']."".number_format($total['total'])."".number_format($transfer['total'])."".number_format($credit['total'])."".number_format($bca['total'])."".number_format($mandiri['total'])."".number_format($maybank['total'])."".number_format($bri['total'])."".number_format($total['total']+$credit['total']+$transfer['total'])."**

avatar teguhibs
@teguhibs

1 Kontribusi 0 Poin

Dipost 5 tahun yang lalu

Belum ada Jawaban. Jadi yang pertama Jawaban

Login untuk ikut Jawaban