Don't understand posted update query answers

T

terryc

Read a lot of posts but ...

One table called Address has field cell and field email. no data in those
fields.
Second table called Cell has field cell and field email with data.
Address table has 2000+records.
Cell table only has 136 records.

How do I get Cell table data in Address table? Then I'll delete Cell table.
 
G

Gina Whipp

Terry,

Before you you update the table, how are they related? And, are you sure
this is a one to one table relationship. I mean it's possible it's a one to
many or a many to many... Some people might have two cell numbers, one
personal and one for work. The address table might have two addresses, home
and vacation which one gets the number or do they both get the number?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
T

terryc

There is an entity table that has the name fields. It has a one to many with
the address table. There are about 6 individuals with summer/winter
addresses. The cell table has only 1 record for a person. No one has 2 cells
or email addresses.
 
G

Gina Whipp

Terry,

So how do you want to enter the cell number for all the addresses for the
same Entity? You said the cell number goes in the table with the addresses.
I'm also not quite sure I understand why you want to merge. I have set up
databases just that way with names in one table, addresses in another table
and phone numbers in another table because of the one to many and the fact
that some people just have alot of numbers so I rather it be one to many
related to person.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
T

terryc

I set the tables up separately for the very reason you mention. But I can't
get my queries to produce valid data and I got tired of fighting with the
extra table. I thought one less table is one less problem. I struggle with
joins, and unupdateable queries.

I want to be able to pull from entity, entity_type, addresses, cell and
relationship tables and come up with a complete record. Entity_types are
codes for whether the entity is a resident, board member, contributor or a
family - a method to sort for different lists. Relationship is one to many as
a resident can be related to many. The primary key in all the tables is
peopleID. In the relationship table I also have a field residentId which is
the resident's peopleID.

Last night I experimented with a query within a query. Thanks for you help.
 
G

Gina Whipp

Terry,

Let's just fix the query then. Can you copy/paste what you have that is not
working for you here? Because I honestly thing combining the tables is not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
T

terryc

With the cell table i get 185 records. Without I get 747. Is this what you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone, Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID = Relationships.People_ID)
INNER JOIN Cell ON [qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;
 
G

Gina Whipp

Yes, that is what I asked for but I see there is more information. What is
the SQL for qrymaster_resident and what is the Relationship table?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
With the cell table i get 185 records. Without I get 747. Is this what you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON [qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


Gina Whipp said:
Terry,

Let's just fix the query then. Can you copy/paste what you have that is
not
working for you here? Because I honestly thing combining the tables is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm




.
 
G

Gina Whipp

Oops, forgot, did you try a LEFT JOIN?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
With the cell table i get 185 records. Without I get 747. Is this what you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON [qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


Gina Whipp said:
Terry,

Let's just fix the query then. Can you copy/paste what you have that is
not
working for you here? Because I honestly thing combining the tables is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm




.
 
T

terryc

Relationship table: primary key peopleID. Many people are related to a
resident (children, sibling etc). I made a field ResidentID because I didn't
think I could have 2 peopleID fields in the same table. The ResidentID is the
same as the resident's peopleID - just the different field name.

SELECT Entity.Last_Name, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.People_ID, Entity.First_Name, Entity.Prefix,
Entity.Spouse, Address.Address1, Address.Address2, Trim([City] & " " &
[State] & " " & [Zip]) AS Address3, Entity.Archive, Entity.Greeting,
Address.Zip, Address.Address_Type, Address.Phone
FROM Entity LEFT JOIN Address ON Entity.People_ID = Address.People_ID
WHERE (((Entity.Archive)=False));

Thank you for your continuing help.

Gina Whipp said:
Yes, that is what I asked for but I see there is more information. What is
the SQL for qrymaster_resident and what is the Relationship table?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
With the cell table i get 185 records. Without I get 747. Is this what you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON [qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


Gina Whipp said:
Terry,

Let's just fix the query then. Can you copy/paste what you have that is
not
working for you here? Because I honestly thing combining the tables is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I set the tables up separately for the very reason you mention. But I
can't
get my queries to produce valid data and I got tired of fighting with
the
extra table. I thought one less table is one less problem. I struggle
with
joins, and unupdateable queries.

I want to be able to pull from entity, entity_type, addresses, cell and
relationship tables and come up with a complete record. Entity_types
are
codes for whether the entity is a resident, board member, contributor
or a
family - a method to sort for different lists. Relationship is one to
many
as
a resident can be related to many. The primary key in all the tables is
peopleID. In the relationship table I also have a field residentId
which
is
the resident's peopleID.

Last night I experimented with a query within a query. Thanks for you
help.





:

Terry,

So how do you want to enter the cell number for all the addresses for
the
same Entity? You said the cell number goes in the table with the
addresses.
I'm also not quite sure I understand why you want to merge. I have
set
up
databases just that way with names in one table, addresses in another
table
and phone numbers in another table because of the one to many and the
fact
that some people just have alot of numbers so I rather it be one to
many
related to person.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is an entity table that has the name fields. It has a one to
many
with
the address table. There are about 6 individuals with summer/winter
addresses. The cell table has only 1 record for a person. No one has
2
cells
or email addresses.

:

Terry,

Before you you update the table, how are they related? And, are
you
sure
this is a one to one table relationship. I mean it's possible it's
a
one
to
many or a many to many... Some people might have two cell numbers,
one
personal and one for work. The address table might have two
addresses,
home
and vacation which one gets the number or do they both get the
number?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Read a lot of posts but ...

One table called Address has field cell and field email. no data
in
those
fields.
Second table called Cell has field cell and field email with
data.
Address table has 2000+records.
Cell table only has 136 records.

How do I get Cell table data in Address table? Then I'll delete
Cell
table.


.



.



.


.
 
T

terryc

I changed the last join to LEFT and it returned 750 records and that sounds
about right. Thank you.

So I experimented without nesting a query within the query and the SQL is
below. I can't get the output to produce 750 records. Which joins are
incorrect?

SELECT Entity.People_ID, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.Spouse, Entity.Archive, Entity_type.Entity_Type,
Address.Address1, Address.Address2, Trim([City] & " " & [State] & " " &
[Zip]) AS Address3, Address.Phone, Cell.Cell, Cell.Email,
Relationships.Relationship, Relationships.Resident, Relationships.Resident_ID
FROM (((Entity INNER JOIN Entity_type ON Entity.People_ID =
Entity_type.People_ID) INNER JOIN Address ON Entity.People_ID =
Address.People_ID) INNER JOIN Cell ON Entity.People_ID = Cell.People_ID) LEFT
JOIN Relationships ON Entity.People_ID = Relationships.People_ID
WHERE (((Entity.Archive) Is Null) AND ((Entity_type.Entity_Type)="R")) OR
(((Entity_type.Entity_Type)="M")) OR (((Entity_type.Entity_Type)="F"));


Gina Whipp said:
Oops, forgot, did you try a LEFT JOIN?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
With the cell table i get 185 records. Without I get 747. Is this what you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON [qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


Gina Whipp said:
Terry,

Let's just fix the query then. Can you copy/paste what you have that is
not
working for you here? Because I honestly thing combining the tables is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I set the tables up separately for the very reason you mention. But I
can't
get my queries to produce valid data and I got tired of fighting with
the
extra table. I thought one less table is one less problem. I struggle
with
joins, and unupdateable queries.

I want to be able to pull from entity, entity_type, addresses, cell and
relationship tables and come up with a complete record. Entity_types
are
codes for whether the entity is a resident, board member, contributor
or a
family - a method to sort for different lists. Relationship is one to
many
as
a resident can be related to many. The primary key in all the tables is
peopleID. In the relationship table I also have a field residentId
which
is
the resident's peopleID.

Last night I experimented with a query within a query. Thanks for you
help.





:

Terry,

So how do you want to enter the cell number for all the addresses for
the
same Entity? You said the cell number goes in the table with the
addresses.
I'm also not quite sure I understand why you want to merge. I have
set
up
databases just that way with names in one table, addresses in another
table
and phone numbers in another table because of the one to many and the
fact
that some people just have alot of numbers so I rather it be one to
many
related to person.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is an entity table that has the name fields. It has a one to
many
with
the address table. There are about 6 individuals with summer/winter
addresses. The cell table has only 1 record for a person. No one has
2
cells
or email addresses.

:

Terry,

Before you you update the table, how are they related? And, are
you
sure
this is a one to one table relationship. I mean it's possible it's
a
one
to
many or a many to many... Some people might have two cell numbers,
one
personal and one for work. The address table might have two
addresses,
home
and vacation which one gets the number or do they both get the
number?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Read a lot of posts but ...

One table called Address has field cell and field email. no data
in
those
fields.
Second table called Cell has field cell and field email with
data.
Address table has 2000+records.
Cell table only has 136 records.

How do I get Cell table data in Address table? Then I'll delete
Cell
table.


.



.



.


.
 
T

terryc

Spoke to soon. Where archive = false isn't working. Getting true and false
records.

Gina Whipp said:
Oops, forgot, did you try a LEFT JOIN?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
With the cell table i get 185 records. Without I get 747. Is this what you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON [qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


Gina Whipp said:
Terry,

Let's just fix the query then. Can you copy/paste what you have that is
not
working for you here? Because I honestly thing combining the tables is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I set the tables up separately for the very reason you mention. But I
can't
get my queries to produce valid data and I got tired of fighting with
the
extra table. I thought one less table is one less problem. I struggle
with
joins, and unupdateable queries.

I want to be able to pull from entity, entity_type, addresses, cell and
relationship tables and come up with a complete record. Entity_types
are
codes for whether the entity is a resident, board member, contributor
or a
family - a method to sort for different lists. Relationship is one to
many
as
a resident can be related to many. The primary key in all the tables is
peopleID. In the relationship table I also have a field residentId
which
is
the resident's peopleID.

Last night I experimented with a query within a query. Thanks for you
help.





:

Terry,

So how do you want to enter the cell number for all the addresses for
the
same Entity? You said the cell number goes in the table with the
addresses.
I'm also not quite sure I understand why you want to merge. I have
set
up
databases just that way with names in one table, addresses in another
table
and phone numbers in another table because of the one to many and the
fact
that some people just have alot of numbers so I rather it be one to
many
related to person.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is an entity table that has the name fields. It has a one to
many
with
the address table. There are about 6 individuals with summer/winter
addresses. The cell table has only 1 record for a person. No one has
2
cells
or email addresses.

:

Terry,

Before you you update the table, how are they related? And, are
you
sure
this is a one to one table relationship. I mean it's possible it's
a
one
to
many or a many to many... Some people might have two cell numbers,
one
personal and one for work. The address table might have two
addresses,
home
and vacation which one gets the number or do they both get the
number?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Read a lot of posts but ...

One table called Address has field cell and field email. no data
in
those
fields.
Second table called Cell has field cell and field email with
data.
Address table has 2000+records.
Cell table only has 136 records.

How do I get Cell table data in Address table? Then I'll delete
Cell
table.


.



.



.


.
 
G

Gina Whipp

I do not see a WHERE Archive = False in your previous statement... What did
you change? Maybe copy/paste what you have changed it to?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
Spoke to soon. Where archive = false isn't working. Getting true and false
records.

Gina Whipp said:
Oops, forgot, did you try a LEFT JOIN?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
With the cell table i get 185 records. Without I get 747. Is this what
you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell,
Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships
ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON [qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


:

Terry,

Let's just fix the query then. Can you copy/paste what you have that
is
not
working for you here? Because I honestly thing combining the tables
is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I set the tables up separately for the very reason you mention. But I
can't
get my queries to produce valid data and I got tired of fighting
with
the
extra table. I thought one less table is one less problem. I
struggle
with
joins, and unupdateable queries.

I want to be able to pull from entity, entity_type, addresses, cell
and
relationship tables and come up with a complete record. Entity_types
are
codes for whether the entity is a resident, board member,
contributor
or a
family - a method to sort for different lists. Relationship is one
to
many
as
a resident can be related to many. The primary key in all the tables
is
peopleID. In the relationship table I also have a field residentId
which
is
the resident's peopleID.

Last night I experimented with a query within a query. Thanks for
you
help.





:

Terry,

So how do you want to enter the cell number for all the addresses
for
the
same Entity? You said the cell number goes in the table with the
addresses.
I'm also not quite sure I understand why you want to merge. I have
set
up
databases just that way with names in one table, addresses in
another
table
and phone numbers in another table because of the one to many and
the
fact
that some people just have alot of numbers so I rather it be one to
many
related to person.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is an entity table that has the name fields. It has a one
to
many
with
the address table. There are about 6 individuals with
summer/winter
addresses. The cell table has only 1 record for a person. No one
has
2
cells
or email addresses.

:

Terry,

Before you you update the table, how are they related? And, are
you
sure
this is a one to one table relationship. I mean it's possible
it's
a
one
to
many or a many to many... Some people might have two cell
numbers,
one
personal and one for work. The address table might have two
addresses,
home
and vacation which one gets the number or do they both get the
number?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Read a lot of posts but ...

One table called Address has field cell and field email. no
data
in
those
fields.
Second table called Cell has field cell and field email with
data.
Address table has 2000+records.
Cell table only has 136 records.

How do I get Cell table data in Address table? Then I'll
delete
Cell
table.


.



.



.


.
 
T

terryc

Gina,

The Where Archive=false is in the qrymaster_resident/family_address_list
which is embedded into the qrymaster_resident/family/relationship_list. When
I run the query by itself, it returns only trues. When the qry is inserted
into the other query, it returns true and false.

In my new query (qryResident_Family_Mailing_List) I omitted the archive
criteria. I've corrected it below. I'm trying to avoid embedding a queries.

SELECT Entity.People_ID, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.Spouse, Entity.Archive, Entity_type.Entity_Type,
Address.Address1, Address.Address2, Trim([City] & " " & [State] & " " &
[Zip]) AS Address3, Address.Phone, Cell.Cell, Cell.Email,
Relationships.Relationship, Relationships.Resident, Relationships.Resident_ID
FROM (((Entity INNER JOIN Address ON Entity.People_ID = Address.People_ID)
INNER JOIN Cell ON Entity.People_ID = Cell.People_ID) INNER JOIN Entity_type
ON Entity.People_ID = Entity_type.People_ID) LEFT JOIN Relationships ON
Entity.People_ID = Relationships.People_ID
WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R")) OR
(((Entity_type.Entity_Type)="M")) OR (((Entity_type.Entity_Type)="F"));



Gina Whipp said:
I do not see a WHERE Archive = False in your previous statement... What did
you change? Maybe copy/paste what you have changed it to?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
Spoke to soon. Where archive = false isn't working. Getting true and false
records.

Gina Whipp said:
Oops, forgot, did you try a LEFT JOIN?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With the cell table i get 185 records. Without I get 747. Is this what
you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell,
Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships
ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON [qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


:

Terry,

Let's just fix the query then. Can you copy/paste what you have that
is
not
working for you here? Because I honestly thing combining the tables
is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I set the tables up separately for the very reason you mention. But I
can't
get my queries to produce valid data and I got tired of fighting
with
the
extra table. I thought one less table is one less problem. I
struggle
with
joins, and unupdateable queries.

I want to be able to pull from entity, entity_type, addresses, cell
and
relationship tables and come up with a complete record. Entity_types
are
codes for whether the entity is a resident, board member,
contributor
or a
family - a method to sort for different lists. Relationship is one
to
many
as
a resident can be related to many. The primary key in all the tables
is
peopleID. In the relationship table I also have a field residentId
which
is
the resident's peopleID.

Last night I experimented with a query within a query. Thanks for
you
help.





:

Terry,

So how do you want to enter the cell number for all the addresses
for
the
same Entity? You said the cell number goes in the table with the
addresses.
I'm also not quite sure I understand why you want to merge. I have
set
up
databases just that way with names in one table, addresses in
another
table
and phone numbers in another table because of the one to many and
the
fact
that some people just have alot of numbers so I rather it be one to
many
related to person.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is an entity table that has the name fields. It has a one
to
many
with
the address table. There are about 6 individuals with
summer/winter
addresses. The cell table has only 1 record for a person. No one
has
2
cells
or email addresses.

:

Terry,

Before you you update the table, how are they related? And, are
you
sure
this is a one to one table relationship. I mean it's possible
it's
a
one
to
many or a many to many... Some people might have two cell
numbers,
one
personal and one for work. The address table might have two
addresses,
home
and vacation which one gets the number or do they both get the
number?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Read a lot of posts but ...

One table called Address has field cell and field email. no
data
in
those
fields.
Second table called Cell has field cell and field email with
data.
Address table has 2000+records.
Cell table only has 136 records.

How do I get Cell table data in Address table? Then I'll
delete
Cell
table.


.



.



.



.


.
 
G

Gina Whipp

Terry,

Are you saying now it works or it still not working?

Why does this AND instead of OR?

WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R")) OR

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
Gina,

The Where Archive=false is in the qrymaster_resident/family_address_list
which is embedded into the qrymaster_resident/family/relationship_list.
When
I run the query by itself, it returns only trues. When the qry is inserted
into the other query, it returns true and false.

In my new query (qryResident_Family_Mailing_List) I omitted the archive
criteria. I've corrected it below. I'm trying to avoid embedding a
queries.

SELECT Entity.People_ID, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.Spouse, Entity.Archive,
Entity_type.Entity_Type,
Address.Address1, Address.Address2, Trim([City] & " " & [State] & " " &
[Zip]) AS Address3, Address.Phone, Cell.Cell, Cell.Email,
Relationships.Relationship, Relationships.Resident,
Relationships.Resident_ID
FROM (((Entity INNER JOIN Address ON Entity.People_ID = Address.People_ID)
INNER JOIN Cell ON Entity.People_ID = Cell.People_ID) INNER JOIN
Entity_type
ON Entity.People_ID = Entity_type.People_ID) LEFT JOIN Relationships ON
Entity.People_ID = Relationships.People_ID
WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R")) OR
(((Entity_type.Entity_Type)="M")) OR (((Entity_type.Entity_Type)="F"));



Gina Whipp said:
I do not see a WHERE Archive = False in your previous statement... What
did
you change? Maybe copy/paste what you have changed it to?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
Spoke to soon. Where archive = false isn't working. Getting true and
false
records.

:

Oops, forgot, did you try a LEFT JOIN?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With the cell table i get 185 records. Without I get 747. Is this
what
you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell,
Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN
Relationships
ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


:

Terry,

Let's just fix the query then. Can you copy/paste what you have
that
is
not
working for you here? Because I honestly thing combining the
tables
is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I set the tables up separately for the very reason you mention.
But I
can't
get my queries to produce valid data and I got tired of fighting
with
the
extra table. I thought one less table is one less problem. I
struggle
with
joins, and unupdateable queries.

I want to be able to pull from entity, entity_type, addresses,
cell
and
relationship tables and come up with a complete record.
Entity_types
are
codes for whether the entity is a resident, board member,
contributor
or a
family - a method to sort for different lists. Relationship is
one
to
many
as
a resident can be related to many. The primary key in all the
tables
is
peopleID. In the relationship table I also have a field
residentId
which
is
the resident's peopleID.

Last night I experimented with a query within a query. Thanks for
you
help.





:

Terry,

So how do you want to enter the cell number for all the
addresses
for
the
same Entity? You said the cell number goes in the table with
the
addresses.
I'm also not quite sure I understand why you want to merge. I
have
set
up
databases just that way with names in one table, addresses in
another
table
and phone numbers in another table because of the one to many
and
the
fact
that some people just have alot of numbers so I rather it be one
to
many
related to person.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is an entity table that has the name fields. It has a
one
to
many
with
the address table. There are about 6 individuals with
summer/winter
addresses. The cell table has only 1 record for a person. No
one
has
2
cells
or email addresses.

:

Terry,

Before you you update the table, how are they related? And,
are
you
sure
this is a one to one table relationship. I mean it's
possible
it's
a
one
to
many or a many to many... Some people might have two cell
numbers,
one
personal and one for work. The address table might have two
addresses,
home
and vacation which one gets the number or do they both get
the
number?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Read a lot of posts but ...

One table called Address has field cell and field email. no
data
in
those
fields.
Second table called Cell has field cell and field email
with
data.
Address table has 2000+records.
Cell table only has 136 records.

How do I get Cell table data in Address table? Then I'll
delete
Cell
table.


.



.



.



.


.
 
T

terryc

I'm sorry Gina. I shouldn't be mixing 2 problems at the same time.
Original problem:
Here's the 1st query which is running correctly.

SELECT Entity.Last_Name, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.People_ID, Entity.First_Name, Entity.Prefix,
Entity.Spouse, Address.Address1, Address.Address2, Trim([City] & " " &
[State] & " " & [Zip]) AS Address3, Entity.Archive, Entity.Greeting,
Address.Zip, Address.Address_Type, Address.Phone
FROM Entity LEFT JOIN Address ON Entity.People_ID = Address.People_ID
WHERE (((Entity.Archive)=False));

The above query is then inserted to the following query that is not working
correctly:

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone, Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID=Relationships.People_ID)
LEFT JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID=Cell.People_ID
WHERE ((([qrymaster_resident/family_address_list].Archive)=False))
ORDER BY Relationships.Resident;

The Archive=False is not working correctly. It is giving me records from the
relationship table that should be excluded.

Thank you.





Gina Whipp said:
Terry,

Are you saying now it works or it still not working?

Why does this AND instead of OR?

WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R")) OR

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
Gina,

The Where Archive=false is in the qrymaster_resident/family_address_list
which is embedded into the qrymaster_resident/family/relationship_list.
When
I run the query by itself, it returns only trues. When the qry is inserted
into the other query, it returns true and false.

In my new query (qryResident_Family_Mailing_List) I omitted the archive
criteria. I've corrected it below. I'm trying to avoid embedding a
queries.

SELECT Entity.People_ID, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.Spouse, Entity.Archive,
Entity_type.Entity_Type,
Address.Address1, Address.Address2, Trim([City] & " " & [State] & " " &
[Zip]) AS Address3, Address.Phone, Cell.Cell, Cell.Email,
Relationships.Relationship, Relationships.Resident,
Relationships.Resident_ID
FROM (((Entity INNER JOIN Address ON Entity.People_ID = Address.People_ID)
INNER JOIN Cell ON Entity.People_ID = Cell.People_ID) INNER JOIN
Entity_type
ON Entity.People_ID = Entity_type.People_ID) LEFT JOIN Relationships ON
Entity.People_ID = Relationships.People_ID
WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R")) OR
(((Entity_type.Entity_Type)="M")) OR (((Entity_type.Entity_Type)="F"));



Gina Whipp said:
I do not see a WHERE Archive = False in your previous statement... What
did
you change? Maybe copy/paste what you have changed it to?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Spoke to soon. Where archive = false isn't working. Getting true and
false
records.

:

Oops, forgot, did you try a LEFT JOIN?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With the cell table i get 185 records. Without I get 747. Is this
what
you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell,
Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN
Relationships
ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


:

Terry,

Let's just fix the query then. Can you copy/paste what you have
that
is
not
working for you here? Because I honestly thing combining the
tables
is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I set the tables up separately for the very reason you mention.
But I
can't
get my queries to produce valid data and I got tired of fighting
with
the
extra table. I thought one less table is one less problem. I
struggle
with
joins, and unupdateable queries.

I want to be able to pull from entity, entity_type, addresses,
cell
and
relationship tables and come up with a complete record.
Entity_types
are
codes for whether the entity is a resident, board member,
contributor
or a
family - a method to sort for different lists. Relationship is
one
to
many
as
a resident can be related to many. The primary key in all the
tables
is
peopleID. In the relationship table I also have a field
residentId
which
is
the resident's peopleID.

Last night I experimented with a query within a query. Thanks for
you
help.





:

Terry,

So how do you want to enter the cell number for all the
addresses
for
the
same Entity? You said the cell number goes in the table with
the
addresses.
I'm also not quite sure I understand why you want to merge. I
have
set
up
databases just that way with names in one table, addresses in
another
table
and phone numbers in another table because of the one to many
and
the
fact
that some people just have alot of numbers so I rather it be one
to
many
related to person.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is an entity table that has the name fields. It has a
one
to
many
with
the address table. There are about 6 individuals with
summer/winter
addresses. The cell table has only 1 record for a person. No
one
has
2
cells
or email addresses.

:

Terry,

Before you you update the table, how are they related? And,
are
you
sure
this is a one to one table relationship. I mean it's
possible
it's
a
one
to
many or a many to many... Some people might have two cell
numbers,
one
personal and one for work. The address table might have two
addresses,
home
and vacation which one gets the number or do they both get
the
number?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Read a lot of posts but ...

One table called Address has field cell and field email. no
data
in
those
fields.
Second table called Cell has field cell and field email
with
data.
Address table has 2000+records.
Cell table only has 136 records.

How do I get Cell table data in Address table? Then I'll
delete
Cell
table.


.



.
 
G

Gina Whipp

Terry,

Well, this is keeping on me on my toes...

So it's the second one that is wrong correct?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
I'm sorry Gina. I shouldn't be mixing 2 problems at the same time.
Original problem:
Here's the 1st query which is running correctly.

SELECT Entity.Last_Name, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.People_ID, Entity.First_Name, Entity.Prefix,
Entity.Spouse, Address.Address1, Address.Address2, Trim([City] & " " &
[State] & " " & [Zip]) AS Address3, Entity.Archive, Entity.Greeting,
Address.Zip, Address.Address_Type, Address.Phone
FROM Entity LEFT JOIN Address ON Entity.People_ID = Address.People_ID
WHERE (((Entity.Archive)=False));

The above query is then inserted to the following query that is not
working
correctly:

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID=Relationships.People_ID)
LEFT JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID=Cell.People_ID
WHERE ((([qrymaster_resident/family_address_list].Archive)=False))
ORDER BY Relationships.Resident;

The Archive=False is not working correctly. It is giving me records from
the
relationship table that should be excluded.

Thank you.





Gina Whipp said:
Terry,

Are you saying now it works or it still not working?

Why does this AND instead of OR?

WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R")) OR

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
Gina,

The Where Archive=false is in the
qrymaster_resident/family_address_list
which is embedded into the qrymaster_resident/family/relationship_list.
When
I run the query by itself, it returns only trues. When the qry is
inserted
into the other query, it returns true and false.

In my new query (qryResident_Family_Mailing_List) I omitted the archive
criteria. I've corrected it below. I'm trying to avoid embedding a
queries.

SELECT Entity.People_ID, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.Spouse, Entity.Archive,
Entity_type.Entity_Type,
Address.Address1, Address.Address2, Trim([City] & " " & [State] & " " &
[Zip]) AS Address3, Address.Phone, Cell.Cell, Cell.Email,
Relationships.Relationship, Relationships.Resident,
Relationships.Resident_ID
FROM (((Entity INNER JOIN Address ON Entity.People_ID =
Address.People_ID)
INNER JOIN Cell ON Entity.People_ID = Cell.People_ID) INNER JOIN
Entity_type
ON Entity.People_ID = Entity_type.People_ID) LEFT JOIN Relationships ON
Entity.People_ID = Relationships.People_ID
WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R")) OR
(((Entity_type.Entity_Type)="M")) OR (((Entity_type.Entity_Type)="F"));



:

I do not see a WHERE Archive = False in your previous statement...
What
did
you change? Maybe copy/paste what you have changed it to?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Spoke to soon. Where archive = false isn't working. Getting true and
false
records.

:

Oops, forgot, did you try a LEFT JOIN?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With the cell table i get 185 records. Without I get 747. Is this
what
you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell,
Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN
Relationships
ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


:

Terry,

Let's just fix the query then. Can you copy/paste what you have
that
is
not
working for you here? Because I honestly thing combining the
tables
is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I set the tables up separately for the very reason you mention.
But I
can't
get my queries to produce valid data and I got tired of
fighting
with
the
extra table. I thought one less table is one less problem. I
struggle
with
joins, and unupdateable queries.

I want to be able to pull from entity, entity_type, addresses,
cell
and
relationship tables and come up with a complete record.
Entity_types
are
codes for whether the entity is a resident, board member,
contributor
or a
family - a method to sort for different lists. Relationship is
one
to
many
as
a resident can be related to many. The primary key in all the
tables
is
peopleID. In the relationship table I also have a field
residentId
which
is
the resident's peopleID.

Last night I experimented with a query within a query. Thanks
for
you
help.





:

Terry,

So how do you want to enter the cell number for all the
addresses
for
the
same Entity? You said the cell number goes in the table with
the
addresses.
I'm also not quite sure I understand why you want to merge.
I
have
set
up
databases just that way with names in one table, addresses in
another
table
and phone numbers in another table because of the one to many
and
the
fact
that some people just have alot of numbers so I rather it be
one
to
many
related to person.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is an entity table that has the name fields. It has a
one
to
many
with
the address table. There are about 6 individuals with
summer/winter
addresses. The cell table has only 1 record for a person.
No
one
has
2
cells
or email addresses.

:

Terry,

Before you you update the table, how are they related?
And,
are
you
sure
this is a one to one table relationship. I mean it's
possible
it's
a
one
to
many or a many to many... Some people might have two cell
numbers,
one
personal and one for work. The address table might have
two
addresses,
home
and vacation which one gets the number or do they both get
the
number?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

message
Read a lot of posts but ...

One table called Address has field cell and field email.
no
data
in
those
fields.
Second table called Cell has field cell and field email
with
data.
Address table has 2000+records.
Cell table only has 136 records.

How do I get Cell table data in Address table? Then I'll
delete
Cell
table.


.



.
 
G

Gina Whipp

Terry,

I am not so sure the second query is working correctly. You have an INNER
JOIN which indicates it's only going to show you records that are in both
objects. You would need a LEFT JOIN on that so you could get all the
reocrds...

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone, Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] LEFT JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID) LEFT JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID = Cell.People_ID
WHERE ((([qrymaster_resident/family_address_list].Archive)=False))
ORDER BY Relationships.Resident;


....I am also confused as to why you have FALSE in two places. It's already
set as the Criteria in the first query, so why do you need it again? The
below should work just fine...

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone, Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] LEFT JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID) LEFT JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID = Cell.People_ID
ORDER BY Relationships.Resident;


....And lastly, not sure what you mean by showing you records it shouldn't
be. If it's got a People_ID from the first query (that is not Archived)
then why shouldn't is show you records in your second/final query?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
I'm sorry Gina. I shouldn't be mixing 2 problems at the same time.
Original problem:
Here's the 1st query which is running correctly.

SELECT Entity.Last_Name, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.People_ID, Entity.First_Name, Entity.Prefix,
Entity.Spouse, Address.Address1, Address.Address2, Trim([City] & " " &
[State] & " " & [Zip]) AS Address3, Entity.Archive, Entity.Greeting,
Address.Zip, Address.Address_Type, Address.Phone
FROM Entity LEFT JOIN Address ON Entity.People_ID = Address.People_ID
WHERE (((Entity.Archive)=False));

The above query is then inserted to the following query that is not
working
correctly:

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID=Relationships.People_ID)
LEFT JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID=Cell.People_ID
WHERE ((([qrymaster_resident/family_address_list].Archive)=False))
ORDER BY Relationships.Resident;

The Archive=False is not working correctly. It is giving me records from
the
relationship table that should be excluded.

Thank you.





Gina Whipp said:
Terry,

Are you saying now it works or it still not working?

Why does this AND instead of OR?

WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R")) OR

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
Gina,

The Where Archive=false is in the
qrymaster_resident/family_address_list
which is embedded into the qrymaster_resident/family/relationship_list.
When
I run the query by itself, it returns only trues. When the qry is
inserted
into the other query, it returns true and false.

In my new query (qryResident_Family_Mailing_List) I omitted the archive
criteria. I've corrected it below. I'm trying to avoid embedding a
queries.

SELECT Entity.People_ID, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.Spouse, Entity.Archive,
Entity_type.Entity_Type,
Address.Address1, Address.Address2, Trim([City] & " " & [State] & " " &
[Zip]) AS Address3, Address.Phone, Cell.Cell, Cell.Email,
Relationships.Relationship, Relationships.Resident,
Relationships.Resident_ID
FROM (((Entity INNER JOIN Address ON Entity.People_ID =
Address.People_ID)
INNER JOIN Cell ON Entity.People_ID = Cell.People_ID) INNER JOIN
Entity_type
ON Entity.People_ID = Entity_type.People_ID) LEFT JOIN Relationships ON
Entity.People_ID = Relationships.People_ID
WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R")) OR
(((Entity_type.Entity_Type)="M")) OR (((Entity_type.Entity_Type)="F"));



:

I do not see a WHERE Archive = False in your previous statement...
What
did
you change? Maybe copy/paste what you have changed it to?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Spoke to soon. Where archive = false isn't working. Getting true and
false
records.

:

Oops, forgot, did you try a LEFT JOIN?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With the cell table i get 185 records. Without I get 747. Is this
what
you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell,
Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN
Relationships
ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


:

Terry,

Let's just fix the query then. Can you copy/paste what you have
that
is
not
working for you here? Because I honestly thing combining the
tables
is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I set the tables up separately for the very reason you mention.
But I
can't
get my queries to produce valid data and I got tired of
fighting
with
the
extra table. I thought one less table is one less problem. I
struggle
with
joins, and unupdateable queries.

I want to be able to pull from entity, entity_type, addresses,
cell
and
relationship tables and come up with a complete record.
Entity_types
are
codes for whether the entity is a resident, board member,
contributor
or a
family - a method to sort for different lists. Relationship is
one
to
many
as
a resident can be related to many. The primary key in all the
tables
is
peopleID. In the relationship table I also have a field
residentId
which
is
the resident's peopleID.

Last night I experimented with a query within a query. Thanks
for
you
help.





:

Terry,

So how do you want to enter the cell number for all the
addresses
for
the
same Entity? You said the cell number goes in the table with
the
addresses.
I'm also not quite sure I understand why you want to merge.
I
have
set
up
databases just that way with names in one table, addresses in
another
table
and phone numbers in another table because of the one to many
and
the
fact
that some people just have alot of numbers so I rather it be
one
to
many
related to person.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is an entity table that has the name fields. It has a
one
to
many
with
the address table. There are about 6 individuals with
summer/winter
addresses. The cell table has only 1 record for a person.
No
one
has
2
cells
or email addresses.

:

Terry,

Before you you update the table, how are they related?
And,
are
you
sure
this is a one to one table relationship. I mean it's
possible
it's
a
one
to
many or a many to many... Some people might have two cell
numbers,
one
personal and one for work. The address table might have
two
addresses,
home
and vacation which one gets the number or do they both get
the
number?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

message
Read a lot of posts but ...

One table called Address has field cell and field email.
no
data
in
those
fields.
Second table called Cell has field cell and field email
with
data.
Address table has 2000+records.
Cell table only has 136 records.

How do I get Cell table data in Address table? Then I'll
delete
Cell
table.


.



.
 
T

terryc

Gina, I'm getting so confused myself! :)

The second query is not working correctly. It is giving me people who should
have been archived and eliminated by the embedded query. I made your 2
suggested changes: change inner to left join and delete the WHERE clause. The
query now returns all 2500 records.

The False stated is in the first query and when the query is embedded into
the second, the statement came along with the first query. Or so it seems to
me.

So here's a question: is it possible to have a query that involves 5 tables
return the exact data you want without embedding queries?

You're being so patient - thank you!

Gina Whipp said:
Terry,

I am not so sure the second query is working correctly. You have an INNER
JOIN which indicates it's only going to show you records that are in both
objects. You would need a LEFT JOIN on that so you could get all the
reocrds...

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone, Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] LEFT JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID) LEFT JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID = Cell.People_ID
WHERE ((([qrymaster_resident/family_address_list].Archive)=False))
ORDER BY Relationships.Resident;


....I am also confused as to why you have FALSE in two places. It's already
set as the Criteria in the first query, so why do you need it again? The
below should work just fine...

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone, Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] LEFT JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID) LEFT JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID = Cell.People_ID
ORDER BY Relationships.Resident;


....And lastly, not sure what you mean by showing you records it shouldn't
be. If it's got a People_ID from the first query (that is not Archived)
then why shouldn't is show you records in your second/final query?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
I'm sorry Gina. I shouldn't be mixing 2 problems at the same time.
Original problem:
Here's the 1st query which is running correctly.

SELECT Entity.Last_Name, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.People_ID, Entity.First_Name, Entity.Prefix,
Entity.Spouse, Address.Address1, Address.Address2, Trim([City] & " " &
[State] & " " & [Zip]) AS Address3, Entity.Archive, Entity.Greeting,
Address.Zip, Address.Address_Type, Address.Phone
FROM Entity LEFT JOIN Address ON Entity.People_ID = Address.People_ID
WHERE (((Entity.Archive)=False));

The above query is then inserted to the following query that is not
working
correctly:

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID=Relationships.People_ID)
LEFT JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID=Cell.People_ID
WHERE ((([qrymaster_resident/family_address_list].Archive)=False))
ORDER BY Relationships.Resident;

The Archive=False is not working correctly. It is giving me records from
the
relationship table that should be excluded.

Thank you.





Gina Whipp said:
Terry,

Are you saying now it works or it still not working?

Why does this AND instead of OR?

WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R")) OR

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Gina,

The Where Archive=false is in the
qrymaster_resident/family_address_list
which is embedded into the qrymaster_resident/family/relationship_list.
When
I run the query by itself, it returns only trues. When the qry is
inserted
into the other query, it returns true and false.

In my new query (qryResident_Family_Mailing_List) I omitted the archive
criteria. I've corrected it below. I'm trying to avoid embedding a
queries.

SELECT Entity.People_ID, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.Spouse, Entity.Archive,
Entity_type.Entity_Type,
Address.Address1, Address.Address2, Trim([City] & " " & [State] & " " &
[Zip]) AS Address3, Address.Phone, Cell.Cell, Cell.Email,
Relationships.Relationship, Relationships.Resident,
Relationships.Resident_ID
FROM (((Entity INNER JOIN Address ON Entity.People_ID =
Address.People_ID)
INNER JOIN Cell ON Entity.People_ID = Cell.People_ID) INNER JOIN
Entity_type
ON Entity.People_ID = Entity_type.People_ID) LEFT JOIN Relationships ON
Entity.People_ID = Relationships.People_ID
WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R")) OR
(((Entity_type.Entity_Type)="M")) OR (((Entity_type.Entity_Type)="F"));



:

I do not see a WHERE Archive = False in your previous statement...
What
did
you change? Maybe copy/paste what you have changed it to?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Spoke to soon. Where archive = false isn't working. Getting true and
false
records.

:

Oops, forgot, did you try a LEFT JOIN?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With the cell table i get 185 records. Without I get 747. Is this
what
you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell,
Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN
Relationships
ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


:

Terry,

Let's just fix the query then. Can you copy/paste what you have
that
is
not
working for you here? Because I honestly thing combining the
tables
is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I set the tables up separately for the very reason you mention.
But I
can't
get my queries to produce valid data and I got tired of
fighting
with
the
extra table. I thought one less table is one less problem. I
struggle
with
joins, and unupdateable queries.

I want to be able to pull from entity, entity_type, addresses,
cell
and
relationship tables and come up with a complete record.
Entity_types
are
codes for whether the entity is a resident, board member,
contributor
or a
family - a method to sort for different lists. Relationship is
one
to
many
as
a resident can be related to many. The primary key in all the
tables
is
peopleID. In the relationship table I also have a field
residentId
which
is
the resident's peopleID.

Last night I experimented with a query within a query. Thanks
for
you
help.





:

Terry,
 
G

Gina Whipp

Terry,

I believe that is because you have a one to many for phone numbers. Each
person can have many phone numbers. It is not because those archived people
are showing up. To prove that find the name of an Archived person and see
if they are in your final table. They will not show. Now find the name of
someone who has three phone numbers, they show three times? See the
problem? Perhaps you need a way to identify a persons Main number thereby
limiting that Cell table to one number per person.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
Gina, I'm getting so confused myself! :)

The second query is not working correctly. It is giving me people who
should
have been archived and eliminated by the embedded query. I made your 2
suggested changes: change inner to left join and delete the WHERE clause.
The
query now returns all 2500 records.

The False stated is in the first query and when the query is embedded into
the second, the statement came along with the first query. Or so it seems
to
me.

So here's a question: is it possible to have a query that involves 5
tables
return the exact data you want without embedding queries?

You're being so patient - thank you!

Gina Whipp said:
Terry,

I am not so sure the second query is working correctly. You have an
INNER
JOIN which indicates it's only going to show you records that are in both
objects. You would need a LEFT JOIN on that so you could get all the
reocrds...

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] LEFT JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID) LEFT JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID = Cell.People_ID
WHERE ((([qrymaster_resident/family_address_list].Archive)=False))
ORDER BY Relationships.Resident;


....I am also confused as to why you have FALSE in two places. It's
already
set as the Criteria in the first query, so why do you need it again? The
below should work just fine...

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell, Cell.Email
FROM ([qrymaster_resident/family_address_list] LEFT JOIN Relationships ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID) LEFT JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID = Cell.People_ID
ORDER BY Relationships.Resident;


....And lastly, not sure what you mean by showing you records it
shouldn't
be. If it's got a People_ID from the first query (that is not Archived)
then why shouldn't is show you records in your second/final query?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

terryc said:
I'm sorry Gina. I shouldn't be mixing 2 problems at the same time.
Original problem:
Here's the 1st query which is running correctly.

SELECT Entity.Last_Name, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.People_ID, Entity.First_Name,
Entity.Prefix,
Entity.Spouse, Address.Address1, Address.Address2, Trim([City] & " " &
[State] & " " & [Zip]) AS Address3, Entity.Archive, Entity.Greeting,
Address.Zip, Address.Address_Type, Address.Phone
FROM Entity LEFT JOIN Address ON Entity.People_ID = Address.People_ID
WHERE (((Entity.Archive)=False));

The above query is then inserted to the following query that is not
working
correctly:

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell,
Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN Relationships
ON
[qrymaster_resident/family_address_list].People_ID=Relationships.People_ID)
LEFT JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID=Cell.People_ID
WHERE ((([qrymaster_resident/family_address_list].Archive)=False))
ORDER BY Relationships.Resident;

The Archive=False is not working correctly. It is giving me records
from
the
relationship table that should be excluded.

Thank you.





:

Terry,

Are you saying now it works or it still not working?

Why does this AND instead of OR?

WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R"))
OR

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Gina,

The Where Archive=false is in the
qrymaster_resident/family_address_list
which is embedded into the
qrymaster_resident/family/relationship_list.
When
I run the query by itself, it returns only trues. When the qry is
inserted
into the other query, it returns true and false.

In my new query (qryResident_Family_Mailing_List) I omitted the
archive
criteria. I've corrected it below. I'm trying to avoid embedding a
queries.

SELECT Entity.People_ID, Trim([Prefix] & " " & [First_Name] & " " &
[Last_Name]) AS Name, Entity.Spouse, Entity.Archive,
Entity_type.Entity_Type,
Address.Address1, Address.Address2, Trim([City] & " " & [State] & "
" &
[Zip]) AS Address3, Address.Phone, Cell.Cell, Cell.Email,
Relationships.Relationship, Relationships.Resident,
Relationships.Resident_ID
FROM (((Entity INNER JOIN Address ON Entity.People_ID =
Address.People_ID)
INNER JOIN Cell ON Entity.People_ID = Cell.People_ID) INNER JOIN
Entity_type
ON Entity.People_ID = Entity_type.People_ID) LEFT JOIN Relationships
ON
Entity.People_ID = Relationships.People_ID
WHERE (((Entity.Archive)=False) AND ((Entity_type.Entity_Type)="R"))
OR
(((Entity_type.Entity_Type)="M")) OR
(((Entity_type.Entity_Type)="F"));



:

I do not see a WHERE Archive = False in your previous statement...
What
did
you change? Maybe copy/paste what you have changed it to?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Spoke to soon. Where archive = false isn't working. Getting true
and
false
records.

:

Oops, forgot, did you try a LEFT JOIN?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With the cell table i get 185 records. Without I get 747. Is
this
what
you
need?

SELECT [qrymaster_resident/family_address_list].People_ID,
[qrymaster_resident/family_address_list].Name,
[qrymaster_resident/family_address_list].Spouse,
[qrymaster_resident/family_address_list].Address1,
[qrymaster_resident/family_address_list].Address2,
[qrymaster_resident/family_address_list].Address3,
[qrymaster_resident/family_address_list].Archive,
[qrymaster_resident/family_address_list].Zip,
[qrymaster_resident/family_address_list].Phone,
Relationships.Relationship,
Relationships.Resident, Relationships.Resident_ID, Cell.Cell,
Cell.Email
FROM ([qrymaster_resident/family_address_list] INNER JOIN
Relationships
ON
[qrymaster_resident/family_address_list].People_ID =
Relationships.People_ID)
INNER JOIN Cell ON
[qrymaster_resident/family_address_list].People_ID =
Cell.People_ID
ORDER BY Relationships.Resident;


:

Terry,

Let's just fix the query then. Can you copy/paste what you
have
that
is
not
working for you here? Because I honestly thing combining the
tables
is
not
a good solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I set the tables up separately for the very reason you
mention.
But I
can't
get my queries to produce valid data and I got tired of
fighting
with
the
extra table. I thought one less table is one less problem.
I
struggle
with
joins, and unupdateable queries.

I want to be able to pull from entity, entity_type,
addresses,
cell
and
relationship tables and come up with a complete record.
Entity_types
are
codes for whether the entity is a resident, board member,
contributor
or a
family - a method to sort for different lists. Relationship
is
one
to
many
as
a resident can be related to many. The primary key in all
the
tables
is
peopleID. In the relationship table I also have a field
residentId
which
is
the resident's peopleID.

Last night I experimented with a query within a query.
Thanks
for
you
help.





:

Terry,
 

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

Top