"Select Appointment.Time as Time,Appointment.Date As Date, (Select Dept_Name From Department Where Department.Dept_Id=Appointment.Dept_Id) As Dept,(Select Staff_Name From staff_name Where staff_name.Staff_Id=Appointment.Staff_Id )As Doctor" +
"(Select Pnt_Name From Patient_Reg Where Patient_Reg.Patient_Id = Appointment.Patient_Id) as Name FROM Appointment";
In it, show an error "Incorrect syntax near 'as' ". Please Suggest me correct syntax
thank you
Loading
Joginder BangerPosted Nov 4, 2014, 7:23 AM
VulpesPosted Nov 4, 2014, 6:18 AM
See if it makes any difference if you place all those words in square brackets e.g [DATE] instead of [DATE].
I'd also place a comma immediately after DOCTOR.
Dipankar BiswasPosted Nov 4, 2014, 5:45 AM
see this link..
http://stackoverflow.com/questions/8654075/incorrect-syntax-near-the-keyword-as-in-sql-server