Okay, so I have 2 tables, one named ClientInformation, and one named ClientFamilyMembers. ClientInformation includes the following fields:
ClientSSN
LastName
FirstName
MI
DOB
Gender
Address
City
State
Zipcode
PhoneNumber
Notes
ClientFamilyMembers includes the following fields:
ClientSSN
FMSSN
LastName
FirstName
MI
DOB
Gender
Relationship
The two tables are joined with a 1-many join through ClientSSN. Basically, what I'm trying to do is create a query that takes all the fields from ClientFamilyMembers, add a field to calculate the person's age, and also include the fields LastName, FirstName, and MI from ClientInformation. When I try to run the query, I get the error message
"The specified field '[DOB]' could refer to more than one table listed in the FROM clause of your SQL statement."
This is what the query looks like in SQL view:
SELECT ClientFamilyMembers.ClientSSN, ClientFamilyMembers.FMSSN, ClientFamilyMembers.LastName, ClientFamilyMembers.FirstName, ClientFamilyMembers.MI, ClientFamilyMembers.DOB, DateDiff("yyyy",[DOB],Now())+Int(Format(Now(),"mmdd")<Format([DOB],"mmdd")) AS Age, ClientFamilyMembers.Gender, ClientFamilyMembers.Relationship, ClientInformation.LastName, ClientInformation.FirstName, ClientInformation.MI
FROM ClientInformation LEFT JOIN ClientFamilyMembers
ON ClientInformation.ClientSSN = ClientFamilyMembers.ClientSSN;
Please Help!
Amanda
ClientSSN
LastName
FirstName
MI
DOB
Gender
Address
City
State
Zipcode
PhoneNumber
Notes
ClientFamilyMembers includes the following fields:
ClientSSN
FMSSN
LastName
FirstName
MI
DOB
Gender
Relationship
The two tables are joined with a 1-many join through ClientSSN. Basically, what I'm trying to do is create a query that takes all the fields from ClientFamilyMembers, add a field to calculate the person's age, and also include the fields LastName, FirstName, and MI from ClientInformation. When I try to run the query, I get the error message
"The specified field '[DOB]' could refer to more than one table listed in the FROM clause of your SQL statement."
This is what the query looks like in SQL view:
SELECT ClientFamilyMembers.ClientSSN, ClientFamilyMembers.FMSSN, ClientFamilyMembers.LastName, ClientFamilyMembers.FirstName, ClientFamilyMembers.MI, ClientFamilyMembers.DOB, DateDiff("yyyy",[DOB],Now())+Int(Format(Now(),"mmdd")<Format([DOB],"mmdd")) AS Age, ClientFamilyMembers.Gender, ClientFamilyMembers.Relationship, ClientInformation.LastName, ClientInformation.FirstName, ClientInformation.MI
FROM ClientInformation LEFT JOIN ClientFamilyMembers
ON ClientInformation.ClientSSN = ClientFamilyMembers.ClientSSN;
Please Help!
Amanda