Tolong pilih kategori sesuai, jenis posting (diskusi atau bukan) dan sertakan tag/topik yang sesuai seperti komputer, java, php, mysql, dll. Promosi atau posting tidak pada tempatnya akan kami hapus!
- Bagi Anda yang ingin mendaftar, baca link berikut:
http://diskusiweb.com/discussion/50491/how-to-registrasi-diskusiweb-com-baca-ini-terlebih-dahulu
- Cara menyisipkan kode program supaya tampil rapi dan terformat dengan baik di diskusiweb.com: http://www.diskusiweb.com/discussion/50415/cara-menyisipkan-kode-program-di-diskusiweb-com
- Cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

Cara Pindah Rumus SQL Acces ke Rumus SQL MySQL

SELECT DaftarBarang.ID, DaftarBarang.User, DaftarBarang.NamaBarang, DaftarBarang.Type, IIf([Forms]![FlapStockPart1]![tgl1]-1<=[Forms]![FlapStockPart1]![tgl2]-1,Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]-1,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]-1,[Qrekapan]![QTY],0))) AS sa, IIf([Forms]![FlapStockPart1]![tgl1]<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1],[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1],[Qrekapan]![QTY],0))) AS 1, IIf([Forms]![FlapStockPart1]![tgl1]+1<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+1,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+1,[Qrekapan]![QTY],0))) AS 2, IIf([Forms]![FlapStockPart1]![tgl1]+2<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+2,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+2,[Qrekapan]![QTY],0))) AS 3, IIf([Forms]![FlapStockPart1]![tgl1]+3<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+3,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+3,[Qrekapan]![QTY],0))) AS 4, IIf([Forms]![FlapStockPart1]![tgl1]+4<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+4,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+4,[Qrekapan]![QTY],0))) AS 5, IIf([Forms]![FlapStockPart1]![tgl1]+5<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+5,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+5,[Qrekapan]![QTY],0))) AS 6, IIf([Forms]![FlapStockPart1]![tgl1]+6<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+6,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+6,[Qrekapan]![QTY],0))) AS 7, IIf([Forms]![FlapStockPart1]![tgl1]+7<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+7,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+7,[Qrekapan]![QTY],0))) AS 8, IIf([Forms]![FlapStockPart1]![tgl1]+8<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+8,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+8,[Qrekapan]![QTY],0))) AS 9, IIf([Forms]![FlapStockPart1]![tgl1]+9<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+9,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+9,[Qrekapan]![QTY],0))) AS 10, IIf([Forms]![FlapStockPart1]![tgl1]+10<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+10,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+10,[Qrekapan]![QTY],0))) AS 11, IIf([Forms]![FlapStockPart1]![tgl1]+11<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+11,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+11,[Qrekapan]![QTY],0))) AS 12, IIf([Forms]![FlapStockPart1]![tgl1]+12<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+12,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+12,[Qrekapan]![QTY],0))) AS 13, IIf([Forms]![FlapStockPart1]![tgl1]+13<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+13,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+13,[Qrekapan]![QTY],0))) AS 14, IIf([Forms]![FlapStockPart1]![tgl1]+14<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+14,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+14,[Qrekapan]![QTY],0))) AS 15, IIf([Forms]![FlapStockPart1]![tgl1]+15<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+15,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]+15,[Qrekapan]![QTY],0))) AS 16, IIf(Sum(IIf([trans]="masuk" And [tanggal]>=[forms]![flapstockpart1]![tgl1] And [tanggal]<=[forms]![flapstockpart1]![tgl2],[qrekapan]![qty],0))>0 Or Sum(IIf([trans]="keluar" And [tanggal]>=[forms]![flapstockpart1]![tgl1] And [tanggal]<=[forms]![flapstockpart1]![tgl2],[qrekapan]![qty],0))>0,1,0) AS f
FROM DaftarBarang LEFT JOIN Qrekapan ON DaftarBarang.ID = Qrekapan.NamaBarang
WHERE (((DaftarBarang.status)="c"))
GROUP BY DaftarBarang.ID, DaftarBarang.User, DaftarBarang.NamaBarang, DaftarBarang.Type
HAVING (((DaftarBarang.User)=[forms]![flapstockpart1]![cmbbagian]) AND ((IIf(Sum(IIf([trans]="masuk" And [tanggal]>=[forms]![flapstockpart1]![tgl1] And [tanggal]<=[forms]![flapstockpart1]![tgl2],[qrekapan]![qty],0))>0 Or Sum(IIf([trans]="keluar" And [tanggal]>=[forms]![flapstockpart1]![tgl1] And [tanggal]<=[forms]![flapstockpart1]![tgl2],[qrekapan]![qty],0))>0,1,0))=1)) OR (((DaftarBarang.User)=[forms]![flapstockpart1]![cmbbagian]) AND ((IIf([Forms]![FlapStockPart1]![tgl1]-1<=[Forms]![FlapStockPart1]![tgl2]-1,Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]-1,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]-1,[Qrekapan]![QTY],0))))>0))
ORDER BY DaftarBarang.User, DaftarBarang.NamaBarang, DaftarBarang.Type;

Comments

  • Para master tolong bantuannya mau bikin cetak laporan stok barang per mingguan berjalan dari rumus access ke rumus mysql ada yang berbeda atau tidak jalan bagaimana ya master terima kasih mohon bantuannya
  • SELECT DaftarBarang.ID, DaftarBarang.User, DaftarBarang.NamaBarang, DaftarBarang.Type, IIf([Forms]![FlapStockPart1]![tgl1]-1<=[Forms]![FlapStockPart1]![tgl2]-1,Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]-1,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]-1,[Qrekapan]![QTY],0))) AS sa, IIf([Forms]![FlapStockPart1]![tgl1]<=[Forms]![FlapStockPart1]![tgl2],Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1],[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1],[Qrekapan]![QTY],0))) AS 1, IIf(Sum(IIf([trans]="masuk" And [tanggal]>=[forms]![flapstockpart1]![tgl1] And [tanggal]<=[forms]![flapstockpart1]![tgl2],[qrekapan]![qty],0))>0 Or Sum(IIf([trans]="keluar" And [tanggal]>=[forms]![flapstockpart1]![tgl1] And [tanggal]<=[forms]![flapstockpart1]![tgl2],[qrekapan]![qty],0))>0,1,0) AS f
    FROM DaftarBarang LEFT JOIN Qrekapan ON DaftarBarang.ID = Qrekapan.NamaBarang
    WHERE (((DaftarBarang.status)="c"))
    GROUP BY DaftarBarang.ID, DaftarBarang.User, DaftarBarang.NamaBarang, DaftarBarang.Type
    HAVING (((DaftarBarang.User)=[forms]![flapstockpart1]![cmbbagian]) AND ((IIf(Sum(IIf([trans]="masuk" And [tanggal]>=[forms]![flapstockpart1]![tgl1] And [tanggal]<=[forms]![flapstockpart1]![tgl2],[qrekapan]![qty],0))>0 Or Sum(IIf([trans]="keluar" And [tanggal]>=[forms]![flapstockpart1]![tgl1] And [tanggal]<=[forms]![flapstockpart1]![tgl2],[qrekapan]![qty],0))>0,1,0))=1)) OR (((DaftarBarang.User)=[forms]![flapstockpart1]![cmbbagian]) AND ((IIf([Forms]![FlapStockPart1]![tgl1]-1<=[Forms]![FlapStockPart1]![tgl2]-1,Sum(IIf([trans]="masuk" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]-1,[Qrekapan]![QTY],0)-IIf([trans]="keluar" And [tanggal]<=[Forms]![FlapStockPart1]![tgl1]-1,[Qrekapan]![QTY],0))))>0))
    ORDER BY DaftarBarang.User, DaftarBarang.NamaBarang, DaftarBarang.Type;

Sign In or Register to comment.