Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VB 6.0 & MS sql server in a p

Status
Not open for further replies.

giyer555

Programmer
Sep 8, 2003
75
IN
Using VB 6.0 & MS sql server in a payroll project having employee master table (emp_mast) & monthly employee earnings & deductions table (emp_earnded) I need to transfer all the employees in the emp_mast table on monthly basis to the emp_earnded table to allow the user to enter the earnings & deductions for each employee.

The emp_earnded table has the following fields: -
Batch_no, emp_code, br_code, ot_hrs, ot_value, leave, leave_val, basic_sal, hra, conveyance, allow1. allow2, sal_advance, tel_telx, van_short, till_short, immigration, month, year, posted

The fields emp_code, br_code, basic_sal, hra, conveyance, allow1, allow2 from emp_mast table has to be updated in emp_earnded table.

This process has to be done from a forms command button using ADO

Kindly advise whether sql syntax will do the needful or any other method has to be applied. If sql has to be applied then which syntax will apply. The remaining fields value in emp_earnded will be fixed & will be as per data input in the forms text box. For eg: the batch_no, month & year value will be taken from the forms text box

Thanx
 
Experts pls reply

Sorry as i forgot to mention the subject properly. Anyways i can't repost the thread.
 
Do this with a stored proceedure.

Look up the sql commands:

INSERT INTO ThisTable([FieldsList])
SELECT [FieldsList]
FROM ForeignTable

and

UPDATE ThisTable
INNER JOIN ForeignTable
On ThisTable.Key = ForeignTable.ForeignKey
SET ThisTable.Field1 = ForeignTable.Field2
 
The specifics of this question make look a lot like a student exercise, which is probably the reason you are not getting any answers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top