Re: ใช้คำสั่ง Union All แล้ว Access ฟ้อง invalid in use is null
Posted: Tue Jun 05, 2018 5:33 am
ตัวอย่าง Query ตามด้านล่างครับ
Code: Select all
SELECT [1_Personal1].PID_SELECT, [1_Personal1].PID_SELECT_FNAME, [1_Personal1].PID_SELECT_MNAME, [1_Personal1].PID_SELECT_LNAME, [1_Personal1].PID_SELECT_SEX, [1_Personal1].PID_SELECT_BIRTHDATE, [1_Personal1].PID_SELECT_NATION, [1_Personal1].PID_SELECT_RELIGION, [1_Personal1].WORK_START_DATE, [1_Personal1].POSITION_REGISTER_ID, '4' AS RELATION, FamilyReport.[Identity Number for Mother] AS PID, KMSTPNEL.[Mother Name] AS PID_FNAME, Mid$(Replace([PID_FNAME],[PID_LNAME],""),InStr([PID_FNAME]," ")+1) AS PID_MNAME, Mid$([PID_FNAME],InStrRev([PID_FNAME]," ")+1) AS PID_LNAME, '2' AS PID_SEX, ' ' AS PID_BIRTHDATE, ' ' AS PID_NATION, ' ' AS PID_RELIGION, ' ' AS CHILD_INCOMPETENT, ' ' AS CHILD_REGULARITY
FROM (KMSTPNEL INNER JOIN 1_Personal1 ON KMSTPNEL.[Personnel ID] = [1_Personal1].[Personnel ID]) LEFT JOIN FamilyReport ON KMSTPNEL.[Personnel ID] = FamilyReport.PersNo
WHERE (((KMSTPNEL.[Mother Name])<>'') AND ((FamilyReport.Membr)='12'));