Tom, This means a doctor always has a location and a clinic, so inner joins will suffice:
<cfquery name="qGetDocs" datasource="DSN"> Select doctors.doctor_name, locations.address, clinics.clinic_name >From doctors, locations, clinics Where doctors.doctor_id = locations.doctor_id AND doctors.doctor_id = clinics.doctor_id Order by clinics.clinic_name, doctors.doctor_name </cfquery> <cfoutput query="qGetDocs" group="clinic_name"> <p>#clinic_name#<br> <cfoutput group="doctor_name"> <ul> #doctor_name# <cfoutput> <br><ul> - #address#</ul> </cfoutput> </ul> <br><br> </cfoutput> </p> </cfoutput> Output code is a little dodgy and would be better in a table, but you get the idea. The only way you can "nest" cfoutput. Good luck. Steve c -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom MacKean Sent: Thursday, 22 April 2004 11:54 AM To: CFAussie Mailing List Subject: [cfaussie] Multiple Tables (newbie question) Hi List, I have tried to get my head around this, but failed. Simply, Consider three MS Access tables... * DOCTORS - Fields: Doctor_ID, Doctor_Name * LOCATIONS - Fields: Doctor_ID, Address (each doctor can have more than one address) * CLINICS - Fields: Doctor_ID, Clinic_Name (each doctor can work at more than one clinic) What I want to do is display... Clinic Name 1 Doctor Name 1 - Address 1-1 - Address 1-2 Doctor Name 2 - Address 2-1 - Address 2-2 Clinic Name 2 Doctor Name 1 (same doc different clinic) - Address 1-1 - Address 1-2 Doctor Name 3 - Address 3-1 - Address 3-2 - Address 3-3 ...etc... Any help/suggestions most welcome... Thanks Tom ________________________________ Tom MacKean Copywriter/Designer Phone: (02) 9229 6465 Fax: (02) 9231 6965 Mobile: 0414 312 803 NOTICE: Medical and scientific information provided in print and electronically by Sydney IVF might not be relevant to your own circumstances and should always be discussed with your own doctor before you act on it. This communication is confidential and may contain copyright or otherwise protected information of Sydney IVF Limited or a third party. If you are not the intended recipient of this communication please immediately let us know by reply email or telephone us on +61 2 9221 5964, delete the communication and destroy all copies. --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004 --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
