S
sunrise987
Hello,
I have three of my database tables joined in a 'select query' and
displayed in a 'form'
I need to be able to update those three tables using the form.
my problem is the resulting 'select query' of joined tables is not
allowing update of record. I don't understand why is this happening.
(I am sure that a 'select query' do allow update of tables in other
cases!) Here is the code that I used:
SELECT
E.[Employment History Entry], E.[Employee ID] AS
[H_Employment_EmployeeID], E.[Effective Date], E.[End Date], E.[Job
Title], E.[Function], E.[Sub Function], E.[Service Group], E.[Grade],
E.[Service Line], E.[Location], E.[Counselor], E.[Additional Role],
B.EmployeeID AS [H_Marital Status_EmployeeID], B.Status, B.[Date of
Update],
Employee.EmployeeID AS Employee_EmployeeID, Employee.[First Name],
Employee.[Middle Name], Employee.[Last Name], Employee.Gender,
Employee.[Place of Birth], Employee.[Date of Birth], Employee.
[Employment Status], Employee.[Nationality 1], Employee.[Nationality
2], Employee.[Blood Type], Employee.[Joining Date as Per Offer
Letter], Employee.[Date of Contract], Employee.[Employee File Number],
Employee.[Beginning of Service at DTME], Employee.[Native Language],
Employee.[Written Skills], Employee.[Verbal Skills]
FROM (Employee LEFT JOIN [H_Employment] AS E
ON Employee.EmployeeID = E.[Employee ID])
LEFT JOIN [H_Marital Status] AS B
ON Employee.EmployeeID = B.EmployeeID
WHERE E.[Effective Date] =
(SELECT Max([Effective Date])
FROM H_Employment AS Tmp
WHERE Tmp.[Employee ID] = E.[Employee ID])
AND B.[Date of Update] =
(SELECT Max([Date of Update])
FROM [H_Marital Status] as Tmp
WHERE Tmp.EmployeeID = B.EmployeeID);
how can I make this query update corresponding tables? Please Help.
I have three of my database tables joined in a 'select query' and
displayed in a 'form'
I need to be able to update those three tables using the form.
my problem is the resulting 'select query' of joined tables is not
allowing update of record. I don't understand why is this happening.
(I am sure that a 'select query' do allow update of tables in other
cases!) Here is the code that I used:
SELECT
E.[Employment History Entry], E.[Employee ID] AS
[H_Employment_EmployeeID], E.[Effective Date], E.[End Date], E.[Job
Title], E.[Function], E.[Sub Function], E.[Service Group], E.[Grade],
E.[Service Line], E.[Location], E.[Counselor], E.[Additional Role],
B.EmployeeID AS [H_Marital Status_EmployeeID], B.Status, B.[Date of
Update],
Employee.EmployeeID AS Employee_EmployeeID, Employee.[First Name],
Employee.[Middle Name], Employee.[Last Name], Employee.Gender,
Employee.[Place of Birth], Employee.[Date of Birth], Employee.
[Employment Status], Employee.[Nationality 1], Employee.[Nationality
2], Employee.[Blood Type], Employee.[Joining Date as Per Offer
Letter], Employee.[Date of Contract], Employee.[Employee File Number],
Employee.[Beginning of Service at DTME], Employee.[Native Language],
Employee.[Written Skills], Employee.[Verbal Skills]
FROM (Employee LEFT JOIN [H_Employment] AS E
ON Employee.EmployeeID = E.[Employee ID])
LEFT JOIN [H_Marital Status] AS B
ON Employee.EmployeeID = B.EmployeeID
WHERE E.[Effective Date] =
(SELECT Max([Effective Date])
FROM H_Employment AS Tmp
WHERE Tmp.[Employee ID] = E.[Employee ID])
AND B.[Date of Update] =
(SELECT Max([Date of Update])
FROM [H_Marital Status] as Tmp
WHERE Tmp.EmployeeID = B.EmployeeID);
how can I make this query update corresponding tables? Please Help.