[Solved] Creating a query of two tables without repeating...
Posted: Wed Sep 19, 2018 6:46 pm
I am working on a simple database with two tables: Events and CAPs. There is a one to many relationship between them where the table CAPs has the foreign key EventID. At the moment the query I'm using to display all information in both tables uses a left outer join, the problem with this is that for each CAP associated with an event it repeats the event data. I would like to know if it's possible to make it display the data from each event only once when there are multiple CAPs. If this isn't something possible to do with queries I was thinking there might be a way to do it with the Report functionality of base.
My current query:
(You can ignore the second or I guess third eventID coulmn that shows up here, I fixed what I did there.)
My current query:
Code: Select all
SELECT "Events1"."EventID" AS "EventID", "Events1"."TimeStamp" AS "TimeStamp", "Events1"."Location" AS "Location", "Events1"."Type" AS "Type", "Events1"."Description" AS "Description", "Events1"."Prelim_Rep_Issued" AS "Prelim_Rep_Issued", "Events1"."Final_Rep_Issued" AS "Final_Rep_Issued", "Events1"."Email_Note" AS "Email_Note", "Events1"."Phone_Note" AS "Phone_Note", "CAPs1"."CAPID" AS "CAPID", "CAPs1"."Description" AS "Description", "CAPs1"."Response" AS "Response", "CAPs1"."Closed_Status" AS "Closed_Status", "CAPs1"."EventID" FROM { OJ "Events1" LEFT OUTER JOIN "CAPs1" ON "Events1"."EventID" = "CAPs1"."EventID" }