S
Sprinks
Access reports that the following is ambiguous because [StaffID] is a field
in both tables:
SELECT Staff.StaffID, [FName] & " " & [LName] AS FirstLast,
DMax("[PeriodBeginning]","TSHistory"," [StaffID]= " & [StaffID]) AS MaxDate
FROM Staff LEFT JOIN TSHistory ON Staff.StaffID = TSHistory.StaffID
WHERE (((Staff.Active)=True))
ORDER BY [FName] & " " & [LName];
If I change it to the following, I get an error message of Invalid Dot
Operator:
SELECT Staff.StaffID, [FName] & " " & [LName] AS FirstLast,
DMax("[PeriodBeginning]","TSHistory"," [StaffID] = " & [Staff].[StaffID]) AS
MaxDate
FROM Staff LEFT JOIN TSHistory ON Staff.StaffID = TSHistory.StaffID
WHERE (((Staff.Active)=True))
ORDER BY [FName] & " " & [LName];
Can anyone help me solve it?
Thank you.
Sprinks
in both tables:
SELECT Staff.StaffID, [FName] & " " & [LName] AS FirstLast,
DMax("[PeriodBeginning]","TSHistory"," [StaffID]= " & [StaffID]) AS MaxDate
FROM Staff LEFT JOIN TSHistory ON Staff.StaffID = TSHistory.StaffID
WHERE (((Staff.Active)=True))
ORDER BY [FName] & " " & [LName];
If I change it to the following, I get an error message of Invalid Dot
Operator:
SELECT Staff.StaffID, [FName] & " " & [LName] AS FirstLast,
DMax("[PeriodBeginning]","TSHistory"," [StaffID] = " & [Staff].[StaffID]) AS
MaxDate
FROM Staff LEFT JOIN TSHistory ON Staff.StaffID = TSHistory.StaffID
WHERE (((Staff.Active)=True))
ORDER BY [FName] & " " & [LName];
Can anyone help me solve it?
Thank you.
Sprinks