Relative Content

Tag Archive for sqlsubquery

How do I get results from one query to influence the second query results

Currently, I have two queries and I would like to condense into one with two SELECT statements. I am using MS Access SQL so that I can create a form later to allow user to add data to search for their criteria using: pathid, ctcode, or casetype. It tells me that I cannot use GROUP_CONCAT() to get achieve a 1 to many result as displayed in my Inner Query picture below (there is only one pathid to one casenumber but many ctcodes for that 1 casenumber). I have 5 tables patcase, billingcode, internalbillingcode, consultinformation, and specimen. I believe I need to run two queries to get the information needed. Any Ideas on how to achieve. My inner query is as follows: