Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community

Multi table query

Copper Contributor


I have created a logbook to record closed and pended issues in the departments and created different tables for each department. I want to know all the pending issues from all the departments. How to create a query for the same. Kindly help.


Annotation 2020-02-18 144442.png

3 Replies
You perform tasks like this with queries. Parameterized queries, to be precise.

In this case, since we can't see anything in the screen shot called "departments" my best guess for this query in this case would include something like this:


On a related note, your table and field names reflect some less than desirable naming choices. We try NOT to incorporate spaces and non-standard characters like the / in names. They can, and often do, create complications. It's better to avoid them.

You have a much more serious design problem in that each department is in a separate table. Unfortunately, queries become significantly more complex when you do that. 

You COULD, as a work around, create a UNION query that includes each of the currently existing tables. That would have to be modified from time to time to accommodate changes in departments, though. 


I strongly urge you to correct this design problem now, rather than continue to invest extra work and complicated queries and code to compensate.


Merge all of them into ONE table, similar to the current one shown in your screen shot, with an additional FIELD in that table to indicate which department that record applies to.

@George Hepworth 


Thanks for the solution