|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Output Help
Okay I fell stupid asking this because I have accomplished this manyJoshua Tipton 07/23/02 10:13 P Try this... I didn't do the caps thing like you are doing but you should getPaul Giesenhagen 07/23/02 10:22 P Output one record then bombed with this errorJoshua Tipton 07/23/02 10:34 P OOPs, change the cfoutput linePaul Giesenhagen 07/23/02 10:48 P Okay I fell stupid asking this because I have accomplished this many times I just cant rememeber tonight. <cfquery name="qry_STATES" datasource="CaptekLab"> SELECT PK_tblSTATEID, State FROM dbo.tblSTATE </cfquery> <table> <cfloop query="qry_states"> <cfquery name="qry_labs" datasource="CaptekLab"> SELECT FK_tblSTATEID, Lab_Name, Lab_City, Lap_Phone FROM tblLABS where fk_tblSTATEID = '#qry_states.pk_tblSTATEID#' </cfquery> <cfoutput query="qry_labs"> <tr> <td>#qry_states.state#</td> <td>#Lab_name#</td> </tr> </cfoutput> </cfloop> </table> I want the state name output once and then a list of all the labs for that state IE Alaska Lab1 Lab2 Lab3 Alabama Lab1 Lab2 Lab3 Try this... I didn't do the caps thing like you are doing but you should get the jist! <cfquery name="qr_states" datasource="CaptekLab"> SELECT s.state, l.lab_name FROM tblstate s, tbllabs l WHERE s.pk_tblSTATEID = l.fk_tblSTATEID GROUP BY s.state, l.lab_name </cfquery> <cfoutput query="qr_states" group="CaptekLab.state"> #qr_states.state#<br> <cfoutput>#qr_states.lab_name#</cfoutput> </cfoutput> Good Luck Paul Giesenhagen QuillDesign ----- Excess quoted text cut - see Original Post for more ----- Output one record then bombed with this error The Error Occurred in C:\Inetpub\wwwroot\captek\apps\LabList\showlablist.cfm: line 46 44 : <cfoutput query="qr_states" group="CaptekLab.state"> 45 : #qr_states.state#<br> 46 : <cfoutput>#qr_states.lab_name#</cfoutput> THIS LINE WAS BOLD 47 : </cfoutput> 48 : </body> Try this... I didn't do the caps thing like you are doing but you should get the jist! <cfquery name="qr_states" datasource="CaptekLab"> SELECT s.state, l.lab_name FROM tblstate s, tbllabs l WHERE s.pk_tblSTATEID = l.fk_tblSTATEID GROUP BY s.state, l.lab_name </cfquery> <cfoutput query="qr_states" group="CaptekLab.state"> #qr_states.state#<br> <cfoutput>#qr_states.lab_name#</cfoutput> </cfoutput> Good Luck Paul Giesenhagen QuillDesign ----- Excess quoted text cut - see Original Post for more ----- OOPs, change the cfoutput line from: <cfoutput query="qr_states" group="CaptekLab.state"> to: <cfoutput query="qr_states" group="state"> Paul Giesenhagen QuillDesign ----- Excess quoted text cut - see Original Post for more -----
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||