Invalid Dot Operator

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
 
S

Sprinks

Thank you, Klatuu. This one is a little embarassing, since I occasionally
get on my soapbox distinguishing the uses of the dot and bang operators!

Best regards.
Sprinks

Klatuu said:
Change them to use !
[Staff]![StaffID]

Sprinks said:
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
 
K

Klatuu

LOL,
yep, I've seen you post about that :)

Funny about how the ! is used in different environments. We usually refer
to it as bang. Long ago when I worked on Tandem computers, it was called the
dammit.
That was because you could issue a command with the ! on the end of it and
it meant execute the command without asking me it I really want to do it. We
thought of it as DO IT DAMMIT

Sprinks said:
Thank you, Klatuu. This one is a little embarassing, since I occasionally
get on my soapbox distinguishing the uses of the dot and bang operators!

Best regards.
Sprinks

Klatuu said:
Change them to use !
[Staff]![StaffID]

Sprinks said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top