01. december 2005 - 13:12Der er
3 kommentarer og 1 løsning
unmatched query giver Invalid Argument
Hejsa jeg har 2 queries, til at finde folk der skal på kursus nr et finder dem som bør komme på kursuset og nr 2 finder dem som er blevet tilmeldt kursus eller allerede har været på kursus. individuelt virker de perfekt, men når jeg laver en unmatched query siger den at det er et invalid argument, mit største problem er at jeg har det til at virke men nu gør det bare ikke mere!!!
nr 1 SELECT * FROM Person INNER JOIN CourseRelation ON Person.JobName = CourseRelation.JobName WHERE CourseRelation.[CourseName]= Course;
nr 2
SELECT * FROM ((Person INNER JOIN PersonCourseRelation ON Person.CoWorkerNo = PersonCourseRelation.CoWorkerNo) INNER JOIN PlannedCourses ON PersonCourseRelation.IDNr = PlannedCourses.IDNr) INNER JOIN Courses ON Courses.CourseName = PlannedCourses.CourseName WHERE Courses.[CourseName] = Course;
unmatched query
SELECT [Dueforcourse].[Courses].[CourseName] AS Expr1, Dueforcourse.Priotet, Dueforcourse.RelationNo, Dueforcourse.Name, Dueforcourse.CoWorkerNo, Dueforcourse.Person.JobName, Dueforcourse.DateOfEmployment, Dueforcourse.JobGroup, Dueforcourse.Hours, Dueforcourse.Resp, Dueforcourse.Active FROM Dueforcourse LEFT JOIN DueForCourse2 ON Dueforcourse.CoWorkerNo = DueForCourse2.Person.CoWorkerNo WHERE (((DueForCourse2.Person.CoWorkerNo) Is Null));
Terry, ja det skulle selvfølgelig have været [Dueforcourse].[CourseRelation].[CourseName] men dette hjælper desværre ikke på mit problem. Jag her prøvede at lave en anden unmatched query men jeg får stadig samme invalid argument.
SELECT DISTINCTROW Dueforcourse.Name, Dueforcourse.CoWorkerNo, Dueforcourse.Person.JobName, Dueforcourse.DateOfEmployment, Dueforcourse.JobGroup, Dueforcourse.LatestDevelopmentTalk, Dueforcourse.StoreNo, Dueforcourse.Hours, Dueforcourse.Resp, Dueforcourse.Active, Dueforcourse.CourseRelation.JobName, Dueforcourse.CourseName, Dueforcourse.Priotet, Dueforcourse.RelationNo FROM Dueforcourse LEFT JOIN DueForCourse2 ON Dueforcourse.CoWorkerNo = DueForCourse2.Person.CoWorkerNo WHERE ((((DueForCourse2.Person.CoWorkerNo) Is Null) AND (Dueforcourse.Priotet = 0) AND (Dueforcourse.Active = TRUE) AND (DateDiff("d",Dueforcourse.DateOfEmployment,Date()) > 0)) OR (((DueForCourse2.Person.CoWorkerNo) Is Null) AND (Dueforcourse.Priotet = 1) AND (Dueforcourse.Active = TRUE) AND (DateDiff("d",Dueforcourse.DateOfEmployment,Date()) > 30)) OR (((DueForCourse2.Person.CoWorkerNo) Is Null) AND (Dueforcourse.Priotet = 2) AND (Dueforcourse.Active = TRUE) AND (DateDiff("d",Dueforcourse.DateOfEmployment,Date()) > 180)) OR (((DueForCourse2.Person.CoWorkerNo) Is Null) AND (Dueforcourse.Priotet = 3) AND (Dueforcourse.Active = TRUE) AND (DateDiff("d",Dueforcourse.DateOfEmployment,Date()) > 365)) OR (((DueForCourse2.Person.CoWorkerNo) Is Null) AND (Dueforcourse.Priotet = 4) AND (Dueforcourse.Active = TRUE) AND (DateDiff("d",Dueforcourse.DateOfEmployment,Date()) > 545)));
Well thanks for the offer terry, but I have found the error now, some of the data in the Person table had gone corrupt, soo I had too remove 2 lines. Query works like a charm now.
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.