josephrrc
asked on
Ref-Ontana request for code(Unable to get Ontanas EMAIL)
SELECT Sal_Mas.Emp_No, Sal_Mas.Emp_SurName, transfile.tran_empno, transfile.SalaryAdv, Sal_Mas.Emp_Basicsal, Sal_Mas.Allow1, Sal_Mas.Allow2, Sal_Mas.Allow3, Sal_Mas.Allow4, Sal_Mas.Allow5, Sal_Mas.Allow6, Sal_Mas.Allow7, Sal_Mas.Allow8, Sal_Mas.InterimAllow, transfile.Festadv, transfile.Lunch, transfile.StaffPfContr, transfile.Loan, transfile.CollegePFLoan, transfile.Paye, transfile.SundryDed,
FROM Sal_Mas, transfile WHERE
Sal_Mas.Emp_No = transfile.tran_empno
UNABLE TO GET ALL TRANSACTIONS FROM MASTERFILE PLS HELP ME WITH THE CODE
MASTER FILE IS sal_mas
FROM Sal_Mas, transfile WHERE
Sal_Mas.Emp_No = transfile.tran_empno
UNABLE TO GET ALL TRANSACTIONS FROM MASTERFILE PLS HELP ME WITH THE CODE
MASTER FILE IS sal_mas
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi the answer is so simple you have done every thing right but if you go once agin from your query you will find that in the select statement (before the where clause) you didnot mention the "transfile.tran_empno" field.
The right query shoul be like
SELECT Sal_Mas.Emp_No, Sal_Mas.Emp_SurName, transfile.tran_empno, transfile.SalaryAdv, Sal_Mas.Emp_Basicsal,
Sal_Mas.Allow1, Sal_Mas.Allow2, Sal_Mas.Allow3, Sal_Mas.Allow4, Sal_Mas.Allow5, Sal_Mas.Allow6, Sal_Mas.Allow7,
Sal_Mas.Allow8, Sal_Mas.InterimAllow,trans file.tran_ empno, transfile.Festadv, transfile.Lunch, transfile.StaffPfContr, transfile.Loan,
transfile.CollegePFLoan, transfile.Paye, transfile.SundryDed,
FROM Sal_Mas, transfile WHERE
Sal_Mas.Emp_No = transfile.tran_empno
i know now the program will definately work.
Bye
Loveneesh
The right query shoul be like
SELECT Sal_Mas.Emp_No, Sal_Mas.Emp_SurName, transfile.tran_empno, transfile.SalaryAdv, Sal_Mas.Emp_Basicsal,
Sal_Mas.Allow1, Sal_Mas.Allow2, Sal_Mas.Allow3, Sal_Mas.Allow4, Sal_Mas.Allow5, Sal_Mas.Allow6, Sal_Mas.Allow7,
Sal_Mas.Allow8, Sal_Mas.InterimAllow,trans
transfile.CollegePFLoan, transfile.Paye, transfile.SundryDed,
FROM Sal_Mas, transfile WHERE
Sal_Mas.Emp_No = transfile.tran_empno
i know now the program will definately work.
Bye
Loveneesh
actually, the transfile.tran_empno field WAS already in the query.
Not that it matters if it wasn't, because it's perfectly possible to put a field in the WHERE clause which you have not selected.
But on the topic: Emoreau is right. With a left join you get all records in the first table, linked to their corresponding fields in the other table or a NULL-record where there are no corresponding records.
Hope it helped, :)
Not that it matters if it wasn't, because it's perfectly possible to put a field in the WHERE clause which you have not selected.
But on the topic: Emoreau is right. With a left join you get all records in the first table, linked to their corresponding fields in the other table or a NULL-record where there are no corresponding records.
Hope it helped, :)
ASKER
Thanks to all u nice guys my payroll prg is now working fine.Thanks alot may be any more problems I shall come back again to all u computer wizards
Cheers,
Josephrrc
Cheers,
Josephrrc
ASKER
Thanks to all u nice guys my payroll prg is now working fine.Thanks alot may be any more problems I shall come back again to all u computer wizards
Cheers,
Josephrrc
Cheers,
Josephrrc
You need to accept one of the comment now!
ASKER
Now the prg is working thanks lot
cheers
cheers
SELECT Sal_Mas.Emp_No, Sal_Mas.Emp_SurName, transfile.tran_empno, transfile.SalaryAdv, Sal_Mas.Emp_Basicsal,
Sal_Mas.Allow1, Sal_Mas.Allow2, Sal_Mas.Allow3, Sal_Mas.Allow4, Sal_Mas.Allow5, Sal_Mas.Allow6, Sal_Mas.Allow7,
Sal_Mas.Allow8, Sal_Mas.InterimAllow, transfile.Festadv, transfile.Lunch, transfile.StaffPfContr, transfile.Loan,
transfile.CollegePFLoan, transfile.Paye, transfile.SundryDed
FROM Sal_Mas
LEFT OUTER JOIN transfile
ON Sal_Mas.Emp_No = transfile.tran_empno