The SchoolType table should have a primary key (INT) field which links it to the foreign key schooltype in the schools table. Then the following query will give you what you want
<cfquery name="schools"> Select S.SchoolId, s.SchoolName, ST.SchoolType from schools S INNER JOIN SchoolType ST on S.SchoolType = ST.SchoolType Order by ST.Schooltype </cfquery> <cfoutput query="schools"> <a href="viewschool.cfm?schoolId=#SchoolID#">#SchoolName#</a><br> </cfoutput> <!--- viewschool.cfm would look something like this ---> <cfquery name="school"> Select * from schools Where schoolID = <cfqueryparam value="#URL.SchoolID#" cfsqltype="CF_SQL_INTEGER"> </cfquery> Then output your query here -- snake -----Original Message----- From: Steven Sprouse [mailto:[EMAIL PROTECTED] Sent: 19 July 2006 15:39 To: CF-Talk Subject: Need help building pages with multiple queries and tables I'm new to this forum. I'm hoping there's someone out there that can help me with my problem. I'm trying to build a school directory similar to thi (http://www.mcps.k12.md.us/schools/index.cfm) or this (http://www.wcboe.k12.md.us/content/sch_schools.cfm) I have a Table named Schools with SchoolID, SchoolName, SchoolType, SchoolAddr, etc. and I also have a table called SchoolType with a fieldname of SchoolType that just lists Elementary, Middle, High, Center/Program. I don't know if I set my database up incorrectly or not, but I can't figure out a query (and the query string that I know I need) to get the first page to output a list of schools by School Type, and then when you click on the Go button or the School Name, it brings you to a page with information Specific to that school. Can anyone out there PLEASE help me? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:247047 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

