Outer join queries

bmoyer123
Lounger
Posts: 33
Joined: 05 Jan 2017, 16:12

Outer join queries

Post by bmoyer123 »

I am trying to create a query to use when I print a shipping invoice (report). I had not problem doing this when I created my DB using ACCESS 97 or ACCESS 2003. I am trying to recreate a previous outer join query from multiple tables, and I want all the product data to be displayed even if there is no corresponding data in a given table. Using ACCESS 2016, I am finding I have to create 7 different outer-join queries in order to get the data I want on my report. Is there an easier way.

I could have the following tables:

PATIENTS: need Patient # (link to product), name, Pt weight, Hospcode (link to hospital), PhysID (link to Physician)
Hospital: Hospcode, Name of hospital
Physician: PHYS ID
ALLODONOR: Patient # (link to Patients) need DonorID, Donorname
Product: Collection #, Patient # (link), Date collected, Donor Id, POI (link to Physician order)
Physician Order: POI (link to product), AutoDonor
Processing: Collection # (link),TNC, Volume
ABO/RH: Collection # (link to product), ABORH
Inventory: collection # (link to product) need BAGID, Status, Storage, Shipped

I find I have to create an outer join query between Patients/Hospital/Physician (Query1)
then Query1 with Allodonor (Query2)
then Query2 with Product (Query3)
then Query3 with Physician Order (Query4)
then Query4 with Processing (Query5)
then Query5 with ABO/RH (Query6)
then Query6 with Inventory (Query7)

User avatar
HansV
Administrator
Posts: 78485
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Outer join queries

Post by HansV »

As far as I know, query design hasn't changed between Access 97, 2003 and 2016, so if a query worked in the older versions, it should work in 2016 too.

Could the joins look like this?
S1472.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

bmoyer123
Lounger
Posts: 33
Joined: 05 Jan 2017, 16:12

Re: Outer join queries

Post by bmoyer123 »

That is how I used to have it, but now I get wrong number of records and if i choose outer join I get a ircular error message.

User avatar
HansV
Administrator
Posts: 78485
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Outer join queries

Post by HansV »

Could you create a blank new database, import the tables from your database (structure only, not the records), plus the queries?
Then zip the new database and attach it to a reply.
Best wishes,
Hans

bmoyer123
Lounger
Posts: 33
Joined: 05 Jan 2017, 16:12

Re: Outer join queries

Post by bmoyer123 »

OK I will try, but it may take me awhile to do this. The tables are in one dB and the application and queries are in another one. The application is linked to the tables in DB1.