< prev

Page 1Page 2Page 3Page 4Page 5Page 6Page 7Page 8Page 9Page 10Page 11Page 12Page 13Page 14

Page 13 of 14
next >

Majalah Ilmiah UNIKOM

Vol.9, No. 2

243

H a l a m a n

Dalam sistem informasi ini ada beberapa

fungsi khusus yang dibuat menggunakan

bahasa Visual Basic mapun SQL. Berikut

adalah sebagian contoh implementasi

fungsi

Fungsi Analisis ABC

SELECT DatePart("yyyy",[TglJual]) AS

Tahun, Sum(Nz([QtyJual]*[HargaBeli],0))

AS NilaiBarangTotal

FROM PenjualanRinci

GROUP BY DatePart("yyyy",[TglJual])

ORDER BY Sum(Nz([QtyJual]*

[HargaBeli],0)) DESC;

SELECT PenjualanRinci.IDBarang,

DatePart("yyyy",[TglJual]) AS Tahun, Sum

(Nz([QtyJual],0)) AS Permintaan, Avg

(PenjualanRinci.HargaBeli) AS Biaya, Sum

(Nz([QtyJual]*[HargaBeli],0)) AS

NilaiBarang, ABCStep1.NilaiBarangTotal

FROM PenjualanRinci, ABCStep1

GROUP BY PenjualanRinci.IDBarang,

DatePart("yyyy",[TglJual]),

ABCStep1.NilaiBarangTotal

ORDER BY Sum(Nz([QtyJual]*

[HargaBeli],0)) DESC;

SELECT ABCStep2.IDBarang,

ABCStep2.Tahun, ABCStep2.Permintaan,

ABCStep2.Biaya, ABCStep2.NilaiBarang,

ABCStep2.NilaiBarangTotal, [NilaiBarang]/

[NilaiBarangTotal] AS Persen

FROM ABCStep2;

SELECT ABCStep3.IDBarang,

ABCStep3.Tahun, ABCStep3.Permintaan,

ABCStep3.Biaya, ABCStep3.NilaiBarang,

CLng(DSum

("NilaiBarang","ABCStep3","NilaiBarang>="

& [NilaiBarang] & "")) AS KumNilaiBarang,

ABCStep3.Persen, CDbl(DSum

("Persen","ABCStep3","NilaiBarang>=" &

[NilaiBarang] & "")) AS KumPersen

FROM ABCStep3

ORDER BY ABCStep3.NilaiBarang DESC;

Fungsi ITR

SELECT TransaksiInventori.IDInventori,

TransaksiInventori.TanggalInventori,

[Kuantitas]*[HargaBeli] AS TotalJual

FROM TransaksiInventori

WHERE

(((TransaksiInventori.IDJenisInventori)=2));

SELECT DateDiff("d",Min

([TanggalInventori]),Max

([TanggalInventori]))+1 AS HariKerja

FROM TransaksiInventori;

Fungsi Hitung Pemesanan Ulang

Private Sub Hitung_Click()

Dim LT As Long

Alam Santosa