Multi-part Identifier could not be found
hello everyone,
Please consider the following SQL script -
Code:
use PatientCare
go
select pr.PatientId, p.FirstName,p.LastName, m.Name
from Prescription as pr inner join Patient as p inner join Medicine as m
on p.PatientId = pr.PatientId
on pr.MedicineCode = m.MedicineCode;
For this SQL script, I get the error messages - "multi-part identifier could not be found"
Please help,,,,,,,
Re: Multi-part Identifier could not be found
Do it this way -
Code:
SELECT pr.PatientID, p.FirstName, p.LastName, m.Name
FROM Prescription pr
JOIN Patient p ON p.PatientID = pr.PatientID
JOIN Medicine m ON pr.MedicineCode = m.MedicineCode
or you can do it this way -
Code:
SELECT pr.PatientID, p.FirstName, p.LastName, mName
FROM Prescription pr, Patient p, Medicine m
WHERE p.PatientID = pr.PatientID AND pr.MedicineCode = m.MedicineCode
Re: Multi-part Identifier could not be found
hey Ananias,
I think there was some minor syntax error and the script given by Modifier is correct. Try it....
Re: Multi-part Identifier could not be found
I would really like to thank you guys......the problem is solved.....the script provided by Modifier worked nicely !!!!
Thanks a lot once again.......bye