SELECT 38 ZAP alias38 = ALIAS() SELECT 6 mcode=lcode msec=sec alias6 = ALIAS() INSERT INTO (alias38) (scode, lcode, sec) SELECT DISTINCT scode, lcode, sec FROM (alias6) group by scode,lcode,sec WHERE admtd=1 SELECT 6 SET FILTER TO SET ORDER TO sls GO top *set filter to lcode=mcode.and.admtd=1.and.sec=msec *count to tnostudent Count For admtd=1 and lcode=mcode.and. sec=msec To tnostudent sele 38 SET ORDER TO sls2 replace nostudent WITH tnostudent GO top set filter to scode>=thisform.shiftfm.value and scode<=thisform.shiftto.value.and. sec>=thisform.secfm.value and sec<=thisform.secto.value COUNT TO c if c=0 =messageb('Data Not Found') else go top if thisform.type.value=1 * DO RunReport IN khalid.app WITH 'rt\lstlvl1' repo form rt\lstlvl3 preview DO FILTER endif if thisform.type.value=2 * DO RunReport IN khalid.app WITH 'rt\lstlvl2',[preview] repo form rt\lstlvl2 preview DO FILTER endif endif