Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 access violation

Author  Topic 

sql_lover
Starting Member

14 Posts

Posted - 2007-04-13 : 06:21:21
i am executing this query
Select t.*,t.empname,t.CourseRunning,t.batch_name,count(t.rollno) as noofstudent
from
{
SELECT distinct e.fname+' '+e.mname+' '+e.lname as empname,fmt.CourseRunning,
bm.batch_name,fft.rollno
FROM trainee.FeedBack_Month_Transaction fmt,trainee.employee e,trainee.Faculty_Feedback_Transaction fft,
trainee.batch_master bm
WHERE e.emp_id = fmt.emp_id and bm.batch_code = fft.batch_id and fft.id = fmt.t_id
} t
group by t.empname,t.CourseRunning,t.batch_name

and i m getting this error
[Microsoft][ODBC SQL Server Driver]Syntax error or access violation

help me out coz i m not able to undetstand the error msg

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-04-13 : 06:25:47
use () and not {} for derived table


Select t.*,t.empname,t.CourseRunning,t.batch_name,count(t.rollno) as noofstudent
from
(
SELECT distinct e.fname+' '+e.mname+' '+e.lname as empname,fmt.CourseRunning,
bm.batch_name,fft.rollno
FROM trainee.FeedBack_Month_Transaction fmt,trainee.employee e,trainee.Faculty_Feedback_Transaction fft,
trainee.batch_master bm
WHERE e.emp_id = fmt.emp_id and bm.batch_code = fft.batch_id and fft.id = fmt.t_id
) t
group by t.empname,t.CourseRunning,t.batch_name



KH

Go to Top of Page
   

- Advertisement -