Advertisement
jamboljack

Report Harian

Mar 18th, 2016
1,379
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Create Cursor cur_absen (kd_dep C(3),nama_dep C(50), Total N(5), jml_masuk N(5), jml_tdk_masuk N(5),;
  2.     persen_masuk N(3,2), persen_tdk_masuk N(3,2))
  3. Select * From tb_dep Order By kd_dep Into Cursor cdep
  4. Select cdep
  5. Go Top
  6. Scan
  7.     xkd = Alltrim(cdep.kd_dep)
  8.     xnm_dep = Alltrim(cdep.uraian)
  9.     Select Count(nik) As Total From mas_kar Where kd_dep=xkd And aktif=.T. Into Cursor ctotal
  10.     xtotal = ctotal.Total
  11.     Select Count(nik) As Total From tmp_absen Where tgl=ctgl1 And type_gj=ctype And kd_dep=xkd And Empty(kd_absen) Into Cursor cmasuk
  12.     xmasuk = cmasuk.Total
  13.     Select Count(nik) As Total From tmp_absen Where tgl=ctgl1 And type_gj=ctype And kd_dep=xkd And !Empty(kd_absen) Into Cursor ctdk_masuk
  14.     xtdk_masuk = ctdk_masuk.Total
  15.  
  16.     xpersen_masuk = ((xmasuk*100)/xtotal)
  17.     xpersen_tidak_masuk = ((xtdk_masuk*100)/xtotal)
  18.     Insert Into cur_absen (kd_dep, nama_dep, Total, jml_masuk, jml_tdk_masuk, persen_masuk, persen_tdk_masuk);
  19.         VALUES (xkd, xnm_dep, xtotal, xmasuk, xtdk_masuk, xpersen_masuk, xpersen_tidak_masuk)
  20. Endscan
  21.  
  22. Select cur_absen
  23. Delete For Empty(Total) Or Empty(jml_masuk)
  24. Go Top
Advertisement
RAW Paste Data Copied
Advertisement