Selasa, 25 Agustus 2020

Query Select Left Join with sum

 a

select sia_kelas.*, sia_dagur.idx, sia_dagur.nama,lk,pr 
      from sia_kelas
      left join (select kelas,
      SUM(CASE WHEN kelamin='Laki-laki' THEN 1 ELSE 0 END) as lk,
      SUM(CASE WHEN kelamin='Perempuan' THEN 1 ELSE 0 END) as pr
      from sia_dasis where owner='$owner->owner' and kelas!='' group by kelas) dasis
      on sia_kelas.kelas=dasis.kelas
      LEFT JOIN sia_dagur 
      ON sia_dagur.idx=sia_kelas.wali
      where sia_kelas.owner='$owner->owner
      and sia_kelas.ta='$tahun'
      order by nmr ASC

b

Rabu, 12 Agustus 2020

VBA Excel Macro - Create List a to z

 a'''

Sub u()
ichr = Asc("a")
For i = 0 To 26
    Cells(i, 1) = Chr(ichr + i)

    '---------------------------------------------
    'USER ACTION
    ' Your letter is stored in the variable Letter.
    ' Do what you want with it here.
    ' For example: Range("A" & i) = Letter
    '---------------------------------------------

Next i
End Sub



v

Sabtu, 01 Agustus 2020

Radio Button Event Handler

var rad = document.myForm.myRadios;
var prev = null;
for (var i = 0; i < rad.length; i++) {
    rad[i].addEventListener('change', function() {
        (prev) ? console.log(prev.value): null;
        if (this !== prev) {
            prev = this;
        }
        console.log(this.value)
    });
}
<form name="myForm">
  <input type="radio" name="myRadios"  value="1" />
  <input type="radio" name="myRadios"  value="2" />
</form>

Foto Propades