Hello
I have 3 tables
Table1: FirstName, LastName, ID
Table2: ID, diagnosis (dropdown list), dstartdate, denddate
Table3: ID, admissiondate, dischargedate
I want to create a query that will display the IDs and the dstartdate and denddate from table 2 and admissiondate and dischargedate from table 3. If a person has multiple diagnoses or admissions, I want it to be displayed in separate rows. I want to show the records that apply to the following
(denddsate>=startdate OR dstartdate<=enddate) AND (dischargedate>=startdate OR dischargedate<=enddate)
Startdate and enddate is when the semester starts and ends and will be entered by the userx when opening the query.
Is there a way I can contain everything in one query?
I guess it will be a case of using INNER JOIN twice?
PS I eventually want to create a crosstab query where I will count how many days each ID had each diagnosis (table 2) and was inpatient (table 3)
Thanks
I have 3 tables
Table1: FirstName, LastName, ID
Table2: ID, diagnosis (dropdown list), dstartdate, denddate
Table3: ID, admissiondate, dischargedate
I want to create a query that will display the IDs and the dstartdate and denddate from table 2 and admissiondate and dischargedate from table 3. If a person has multiple diagnoses or admissions, I want it to be displayed in separate rows. I want to show the records that apply to the following
(denddsate>=startdate OR dstartdate<=enddate) AND (dischargedate>=startdate OR dischargedate<=enddate)
Startdate and enddate is when the semester starts and ends and will be entered by the userx when opening the query.
Is there a way I can contain everything in one query?
I guess it will be a case of using INNER JOIN twice?
PS I eventually want to create a crosstab query where I will count how many days each ID had each diagnosis (table 2) and was inpatient (table 3)
Thanks