Code:
icount=1
sele 1
use lcard
dele all
pack
sele 2
use employee
go top
do while not eof()
cempno=empno
do while icount<=31
sele lcard
append blank
replace empno with cempno, dday with icount
icount=icount+1
enddo
icount=1
sele employee
skip
enddo
sele lcard
select empno, swipedate, upcode, t_min, u_min ;
from dtr ;
order by empno, swipedate ;
into cursor crstemp1
sele crstemp1
go top
do while not eof()
ckey=empno+alltrim(str(val(substr(dtoc(swipedate),4,2))))
d=swipedate
a=upcode
t=t_min
u=u_min
sele lcard
locate for empno+alltrim(str(dday))=ckey
if found()
do case
case substr(dtoc(d),1,2)="07"
replace f1 with a, f2 with t, f3 with u
case substr(dtoc(d),1,2)="08"
replace f4 with a, f5 with t, f6 with u
case substr(dtoc(d),1,2)="09"
replace f7 with a, f8 with t, f9 with u
case substr(dtoc(d),1,2)="10"
replace f10 with a, f11 with t, f12 with u
case substr(dtoc(d),1,2)="11"
replace f13 with a, f14 with t, f15 with u
case substr(dtoc(d),1,2)="12"
replace f16 with a, f17 with t, f18 with u
endcase
endif
sele crstemp1
skip
enddo
========================================================
in my previous thread i posted this,
i have this sample data,
Code:
empno date A T U
00001 11/01/2003 S
00001 11/02/2003 10
00001 11/03/2003 F
00001 11/04/2003
00001 11/05/2003
.
.
.
00001 11/30/2003 34
00001 12/01/2003 45
00001 12/02/2003
00001 12/03/2003 S
00001 12/04/2003 X
00001 12/05/2003
.
.
.
00001 12/31/2003
00002 11/01/2003
00002 11/02/2003 10
00002 11/03/2003
00002 11/04/2003 40
00002 11/05/2003
.
.
.
00002 11/30/2003
00002 12/01/2003 S
00002 12/02/2003
00002 12/03/2003
00002 12/04/2003
00002 12/05/2003
.
.
.
00002 12/31/2003
how can i select all these records so that i can have this,
Code:
nov dec
empno day A T U A T U
00001 1 S 45
00001 2 10
00001 3 F
00001 4
00001 5
.
.
.