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?