G
Guest
Tried this question first in the Query discussion group, didn't receive a
response, and since I'm a newby perhaps this is the more appropriate forum
for my problem.
I currently have two queries which both return the desired values; however,
I’m unable to successfully join the two to get the desired results. In my
normalized database’s relationships, there are no defined joins between the
two queries’ underlying tables. Let me digress:
qryCemeteries is constructed solely from tblCemeteries and includes the
fields: CemeteryID (autonumbered, key); CityID (populated from tblCities),
and CountyID (populated from tblCounties) and each field is populated on
every record. There are also numerous other fields in both the tbl and qry
that deal with limited cemetery-specific info including a website hyperlink
field.
qryActiveServices similarly contain three fields: CemeteryID; CityID; and
CountyID—all populated from tblSales, which I assume (and in fairness I
should point out that assumptions are something I routinely screw up) need to
join to the fields of the same name in qryCemeteries (the data types match).
However, in each qryActiveServices record only one ID field will have a value
or none at all (null values then populating all three). Remaining query
fields include website hyperlinks, graphic file hyperlinks, contact info, etc
(all from tblContacts). Some cemeteries will have no related records in
qryActiveServices. If all three qryActiveServices ID record fields are null,
but a qryActiveServices record exists then I’ll unhide the report control for
the field: WebSite from tblCemetery.
What’s needed is a datasheet to include all the cemeteries without
duplicates (from qryCemeteries) and a subdatasheet (from qryActiveServices)
with website and graphic file hyperlink addresses for a specific related
cemetery, a cemetery located in a related city, or a cemetery located within
a related county via the joined ID fields in the two queries. I’ve tried
relating the queries with inner, outer, and 1-to-1 joins without any success,
and it is obvious my limited skills are entirely too woeful to figure this
out. Can someone take pity on me and point me in the right direction
concerning correct joins and anything that will help me build a solution to
this complex problem? Thanks.
response, and since I'm a newby perhaps this is the more appropriate forum
for my problem.
I currently have two queries which both return the desired values; however,
I’m unable to successfully join the two to get the desired results. In my
normalized database’s relationships, there are no defined joins between the
two queries’ underlying tables. Let me digress:
qryCemeteries is constructed solely from tblCemeteries and includes the
fields: CemeteryID (autonumbered, key); CityID (populated from tblCities),
and CountyID (populated from tblCounties) and each field is populated on
every record. There are also numerous other fields in both the tbl and qry
that deal with limited cemetery-specific info including a website hyperlink
field.
qryActiveServices similarly contain three fields: CemeteryID; CityID; and
CountyID—all populated from tblSales, which I assume (and in fairness I
should point out that assumptions are something I routinely screw up) need to
join to the fields of the same name in qryCemeteries (the data types match).
However, in each qryActiveServices record only one ID field will have a value
or none at all (null values then populating all three). Remaining query
fields include website hyperlinks, graphic file hyperlinks, contact info, etc
(all from tblContacts). Some cemeteries will have no related records in
qryActiveServices. If all three qryActiveServices ID record fields are null,
but a qryActiveServices record exists then I’ll unhide the report control for
the field: WebSite from tblCemetery.
What’s needed is a datasheet to include all the cemeteries without
duplicates (from qryCemeteries) and a subdatasheet (from qryActiveServices)
with website and graphic file hyperlink addresses for a specific related
cemetery, a cemetery located in a related city, or a cemetery located within
a related county via the joined ID fields in the two queries. I’ve tried
relating the queries with inner, outer, and 1-to-1 joins without any success,
and it is obvious my limited skills are entirely too woeful to figure this
out. Can someone take pity on me and point me in the right direction
concerning correct joins and anything that will help me build a solution to
this complex problem? Thanks.