0

我在 MySQL 中有一个视图,但出于某种原因,我希望它在 MS Access 中写入。我已经导入了必要的表。当我从 MySQL 复制视图定义并将其写入 Access Query Design 时,它在“加入操作”时出现错误。这里有什么问题?

查看 -> qryOccupation

    select `a`.`Employee_ID` AS `Employee_ID`,`a`.`Employee_Name` AS `Employee_Name`,`a`.`Flat_No` AS `Flat_No`,`a`.`Area` AS `Area`,`a`.`Building_Name` AS `Building_Name` 
from (`tblallotment` `a` join `tblflat` `f`) 
where ((`a`.`Flat_No` = `f`.`Flat_No`) 
and (`f`.`Status` = 'A') 
and (not(`a`.`Employee_ID` in 
(select `c`.`Employee_ID` 
from (`tblallotment` `a` join `tblcancel_allotment` `c`) 
where ((`a`.`Employee_ID` = `c`.`Employee_ID`) 
and (`c`.`Date_Cancellation` = 0))))))
4

2 回答 2

0
("SELECT [Department Name], " _
        & "FirstName & Chr(32) & LastName AS Name " _
        & "FROM Departments LEFT JOIN Employees " _
        & "ON Departments.[Department ID] = " _
        & "Employees.[Department ID] " _
        & "ORDER BY [Department Name];")
于 2012-04-18T06:58:50.303 回答
0
select a.Employee_ID AS Employee_ID,
       a.Employee_Name AS Employee_Name,
       a.Flat_No AS Flat_No,
       a.Area AS Area,
       a.Building_Name AS Building_Name 
from   tblallotment a 
          inner join tblflat f 
            on a.Flat_No = f.Flat_No 
where  f.Status = 'A'
       and (not (a.Employee_ID in 
                (select c.Employee_ID 
                 from   tblallotment a 
                         inner join tblcancel_allotment c 
                            on a.Employee_ID = c.Employee_ID
                  where c.Date_Cancellation = 0)))
于 2012-04-18T07:00:32.263 回答