无法绑定多部分标识符

时间:2014-09-04 14:59:28

标签: sql sql-server-ce

多部分标识符" Reporting_Information.Id_Department_Description"无法受约束。

Select 
    Basic_Information.Company_No, Basic_Information.Company_Name, Basic_Information.Employee_Code,
    Basic_Information.Surname + ' ' +   Basic_Information.Initials AS Employee_Name,
    Employee_Exceptions.Date,
    Employee_Exceptions.Day ,   Employee_Exceptions.Time ,   Employee_Exceptions.Exception,Employee_Exceptions.Exception_Status,    
    Company_Information.Trading_Or_Other_Name,Company_Information.Address_Line_1, 
    Company_Information.Address_Line_2,Company_Information.Address_Line_3,
    Company_Information.Address_Line_Postal_Code,Company_Information.Period_Start_Date,Department_Descriptions.Short_Description ,      
    Company_Information.Period_End_Date,(CASE Company_Information.Payment_Period
        WHEN 'M' THEN 'Monthly (12)'
        WHEN 'B' THEN 'Bi-Weekly (26)' 
        WHEN 'W' THEN 'Weekly (52)'END) as Payment_Period         
from  Employee_Exceptions     
RIGHT OUTER JOIN Basic_Information  
    ON ( Employee_Exceptions.Id_Basic_Information = Basic_Information.Id_Basic_Information)
LEFT OUTER JOIN Company_Information  
    ON ( Company_Information.Id_Company = Basic_Information.Id_Company)
LEFT OUTER JOIN Department_Descriptions 
    ON (Id_Department_Description = Reporting_Information.Id_Department_Description)

请帮忙

1 个答案:

答案 0 :(得分:1)

好的伙计我赢了,我只需要在那里添加额外的加入,
                                                                                      选择Basic_Information.Company_No,Basic_Information.Company_Name,Basic_Information.Employee_Code,
Basic_Information.Surname +''+ Basic_Information.Initials AS Employee_Name,Employee_Exceptions.Date,
Employee_Exceptions.Day,Employee_Exceptions.Time,Employee_Exceptions.Exception,Employee_Exceptions.Exception_Status,
Company_Information.Trading_Or_Other_Name,Company_Information.Address_Line_1, Company_Information.Address_Line_2,Company_Information.Address_Line_3, Company_Information.Address_Line_Postal_Code,Company_Information.Period_Start_Date,Department_Descriptions.Short_Description,
Company_Information.Period_End_Date,(CASE Company_Information.Payment_Period 'M'那么'每月(12)' 当'B'那么'双周刊(26)' 当'W'那么'每周(52)'结束)作为Payment_Period
来自Employee_Exceptions
右外联接Basic_Information
ON(Employee_Exceptions.Id_Basic_Information = Basic_Information.Id_Basic_Information) ---添加加入 LEFT OUTER JOIN Company_Information

ON(Company_Information.Id_Company = Basic_Information.Id_Company)

LEFT OUTER JOIN Reporting_Information ON(Reporting_Information.Id_Basic_Information = Basic_Information.Id_Basic_Information) LEFT OUTER JOIN Department_Descriptions ON(Department_Descriptions.Id_Department_Description = Reporting_Information.Id_Department_Description)