foxpro for windows 2.6

FoxPro 2.6
Microsoft Windows
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
*select b
use att
 	index on e_code to att1
	go bottom
                     scatter memvar blank
*sele a
if seek(e_code)
	&&m->e_code is already there in table
	&& handle the code
*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"
    seek e_code
if found()
	scatter memvar blank
    @ 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"
append blank
gather memvar
clear gets
    @ 19,16 SAY "Do you want to add more records,Y/N?" get m->wish 
clear gets   
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

1. Since your memory variable name (m->e_code) and the field name in table att (e_code)are same, e_code is not getting saved to your table. So change your memory variable name to something else say me_code
2. In your line number 10 you are giving wrong command as e_code = m->e_code as right now your m->e_code is blank and you are taking table field name = memory variable which is blank. Instead you should reverse this command as m->e_code = e_code
3. This will start saving your e_code in table appropriately.
4. Once this starts happening you can very easily calculate total no. of hours for any employee for any period by a simple command.

Discuss This Question:  

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: