I want to store the data i enter into below program but the e_code is not geting stored in the table. Also i wanted to calculate the total no. of hours for each employee on monthly basis.
use empmast
index on e_code tag e_code of empmast
set order to e_code
wish='y'
*select b
use att
index on e_code to att1
go bottom
scatter memvar blank
e_code=m->e_code
*sele a
if seek(e_code)
&&m->e_code is already there in table
&& handle the code
endif
*sele b
do while wish='y'
scatter memvar blank
@ 5,2 say "Enter the Employees Code :" get m->e_code pict "999999" ;
message "Enter the Employee's Code";
Error "Employees Code cannot b blank"
read
seek e_code
if found()
scatter memvar blank
m->date=date()
@ 3,2 say "Today's Date:"
@ 3,20 say m->date pict"@E"
@ 7,2 say "Employees Name:" get m->E_Name pict "@!S20" ;
message "Enter the Employees Name " ;
Error "Employees Name cannot be blank"
@ 9,2 say "Employees Department:" get m->Dept pict"@!S15" ;
message "Enter the Department";
Error "Employees Department cannot be blank"
@ 11,2 say "Shift:" get m->Shift pict "9" ;
message "Enter the Shift" ;
Error "Shift cannot be blank"
@ 13,2 say "Job Code:" get m->Job_Code pict "9999999999" ;
message "Enter the Job_Code:" ;
Error "Job_code cannot be blank"
@ 15,2 say "Location :" get m->Loc pict "@!S20" ;
message "Enter the Location:";
Error "Location cannot be blank"
@ 17,2 say "No. of Hours:" get m->Hours ;
pict "99" valid !empty(m->Hours) ;
message "Enter No. of Hours Worked" ;
Error "Number of Hours cannot be Blank"
read
append blank
gather memvar
clear gets
@ 19,16 SAY "Do you want to add more records,Y/N?" get m->wish
read
clear gets
endif
enddo
clear gets
select date,e_code,e_name,dept,shift,sum(hours) from att group by e_code into table temp
use temp
do while !eof()
&&print your report formatting
skip
enddo
clear Software/Hardware used:
ASKED:
October 9, 2007 10:15 AM
UPDATED:
July 22, 2008 8:20 AM