"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
Incorrect Syntax near "as"
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Dipankar BiswasRank #992 · 2K reputationPosted Nov 4, 2014, 12:45 AM EST
see this link..
http://stackoverflow.com/questions/8654075/incorrect-syntax-near-the-keyword-as-in-sql-server
VulpesRank #55 · 29.2K reputationPosted Nov 4, 2014, 1:18 AM EST
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.
Joginder BangerRank #360 · 7K reputationPosted Nov 4, 2014, 2:23 AM EST