SQL statments that don,t output correctly

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default SQL statments that don,t output correctly

    Hi, All I am have output differences when I run a CFQUERY. I built the query in
    access and when I view the output of the query
    in access it looks fine but when I output the query in CF with a group
    attribute I get the grouping but I only get one output for each category and I
    also get repeated cataegories.

    If someone could help me it would be great thanks.
    Janyer

    JanyerCFML Guest

  2. Similar Questions and Discussions

    1. Flash Forms with cfif statments?
      Does anyone know how to use the <cfif> and <cfelse> statements with the new flash forms, especially with <cfgridcolumn>? Example: <cfgridcolumn...
    2. Carriage returns/output not displayed in output.asp
      PLEASE DON'T MULTIPOST. PLEASE DON'T POST ATTACHMENTS. PLEASE DON'T DOUBLE-POST. Ray at work
    3. #25152 [Opn->Bgs]: output buffering functions don't catch "virtual" output
      ID: 25152 Updated by: iliaa@php.net Reported By: msarsale at buenosaires dot gov dot ar -Status: Open +Status:...
    4. Not Exporting Correctly
      I created a Menu with two behaviors and when I do preview in Fireworks it works fine. But after I export it, only the first behavior is working. ...
    5. If...Then statments
      Hi, How can I use a If..Then Statment in DataGrid?
  3. #2

    Default Re: SQL statments that don,t output correctly

    Sorry, my crystal ball is broken, but if you can provide the relevant code, perhaps we could hazard a quess.

    Phil :D
    paross1 Guest

  4. #3

    Default Re: SQL statments that don,t output correctly

    i ATTACHED TO CODE FOR YOU , THANKS A MILLION

    <cfquery name="q_menuList" datasource="cafe">
    SELECT foodMenu.id, menuCatagory.menuCatagory, foodMenu.menuCategoryId,
    menuCatagory.postionId, foodMenu.name, foodMenu.description, foodMenu.price
    FROM menuPostion INNER JOIN (menuCatagory INNER JOIN foodMenu ON
    menuCatagory.id = foodMenu.menuCategoryId) ON menuPostion.id =
    menuCatagory.postionId
    ORDER BY menuCatagory.postionId
    </cfquery>


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Cafe Ibiza</title>

    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) { //reloads the window if Nav4 resized
    if (init==true) with (navigator) {if
    ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
    onresize=MM_reloadPage; }}
    else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
    location.reload();
    }
    MM_reloadPage(true);
    //-->
    </script>
    <link href="styler.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    body {
    background-color: #F8F3E7;
    }
    .style5 {color: #FFFFFF}
    -->
    </style></head>

    <body>
    <div align="center">
    <table width="774" height="100%" border="0" cellpadding="0" cellspacing="0"
    bgcolor="FFFFFF">
    <tr>
    <td height="226" colspan="2" bgcolor="EEE7C9"><object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
    rsion=6,0,29,0" width="779" height="226">
    <param name="movie" value="images/header.swf">
    <param name="quality" value="high">
    <embed src="images/header.swf" quality="high"
    pluginspage="http://www.macromedia.com/go/getflashplayer"
    type="application/x-shockwave-flash" width="779" height="226"></embed>
    </object></td>
    </tr>
    <tr>
    <td height="3" colspan="2"></td>
    </tr>
    <tr>
    <td height="25" colspan="2" bgcolor="0C2E87"><div align="left"
    class="tableHeader style5">&nbsp;&nbsp;&nbsp;Menu</div></td>
    </tr>
    <tr>
    <td height="3" colspan="2"></td>
    </tr>
    <tr>
    <td width="160" height="100" valign="top" bgcolor="#F2EBD2"><div
    align="left">
    <table width="160" height="100%" border="0" cellpadding="0"
    cellspacing="0" bgcolor="#DDC29F">
    <tr>
    <td width="160" valign="top"
    background="images/background-ibiza.jpg"><p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p><br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    </p></td>
    </tr>
    </table>
    </div></td>
    <td width="619" height="100%" valign="top" bgcolor="#F2EBD2">
    <br>

    <table width="95%" border="0" align="center" cellpadding="4"
    cellspacing="4">
    <cfoutput query="q_menuList" group="menuCategoryId">
    <tr valign="top">

    <td colspan="3"><blockquote class="tableHeader">
    <div align="left">#q_menuList.menuCatagory#</div>
    </blockquote></td>
    </tr>
    <tr valign="top">
    <td width="150"><div align="left"
    class="style2"><strong>#q_menuList.name#</strong></div></td>
    <td><div align="left"
    class="style2">#q_menuList.description#</div></td>
    <td><div align="left" class="requiredAstres">
    <div align="right">#q_menuList.price#</div>
    </div></td>

    </tr>

    <tr valign="top">
    <td colspan="3"><br><br></td>
    </tr>
    </cfoutput>
    </table>


    <p>&nbsp;</p>
    </td>
    </tr>
    <tr>
    <td colspan="2" valign="top" bgcolor="A4A39F"><object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
    rsion=6,0,29,0" width="779" height="50">
    <param name="movie" value="images/banner.swf">
    <param name="quality" value="high">
    <embed src="images/banner.swf" quality="high"
    pluginspage="http://www.macromedia.com/go/getflashplayer"
    type="application/x-shockwave-flash" width="779" height="50"></embed>
    </object></td>
    </tr>
    </table>
    </div>
    </body>
    </html>

    JanyerCFML Guest

  5. #4

    Default Re: SQL statments that don,t output correctly

    I'm not sure exactly how you want the results grouped, but you can nest
    CFOUTPUT tags with group attributes. In other words, you might order by more
    than one field in your query, then your first CFOUTPUT would contain the query
    and group of categoryID, and then have other nested CFOUTPUT tags with other
    group attributes to refine your output display.

    Phil

    paross1 Guest

  6. #5

    Default Re: SQL statments that don,t output correctly

    In addition, the group column in cfoutput has to be the same as the "order by" column in
    your query. You can't order by one column and group by another.
    OldCFer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139