House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Output Help

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Joshua Tipton
07/23/2002 10:13 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Paul Giesenhagen
07/23/2002 10:22 PM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Joshua Tipton
07/23/2002 10:34 PM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Paul Giesenhagen
07/23/2002 10:48 PM

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 -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference