0

Hello, I have an append query in my access, that is linked with sql server 2005.

I want to use an append query that I maked in access, i want to use it in sql server so it can append the records to a specific table.
My query is as follow:

INSERT INTO Marks ( Student_Id, Course_Id, Grupo_Id )
SELECT Attendance.Student_Id, Course.Course_Id, Attendance.Grupo_Id
FROM Grupo_Section INNER JOIN (Course INNER JOIN ((Grupo INNER JOIN Attendance ON Grupo.Grupo_Id = Attendance.Grupo_Id) INNER JOIN Student ON Attendance.Student_Id = Student.Student_Id) ON Course.Course_Id = Grupo.Course_Id) ON (Grupo_Section.Grupo_Date = Attendance.Grupo_Date) AND (Grupo_Section.Grupo_Id = Attendance.Grupo_Id) AND (Grupo_Section.Grupo_Id = Grupo.Grupo_Id)
GROUP BY Attendance.Student_Id, Course.Course_Id, Attendance.Grupo_Id, Attendance.Grupo_Id, Course.Course_Levelid, Attendance.Attend
HAVING (((Course.Course_Levelid)="N1") AND ((Attendance.Attend)=-1) AND ((Count(Attendance.Attend))=1)) OR (((Course.Course_Levelid)="N2") AND ((Attendance.Attend)=-1) AND ((Count(Attendance.Attend))>=3));

How can use this in sql server 2005?

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by sknake
0

It looks like you can just run it as-is. Have you tried?

Yes I have tried it and it gives me this error message;
Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.Grupo_Student'.
And it refers to the INSERT INTO dbo.Marks statement

0

Well that means the table doesn't exist. Does the table exist as a user object and not as dbo.TableName?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.