Query output skipping every other row

I am using Coldfusion MX 7.0.1, and have two applications
using the same datasource. In one, a SELECT query followed by a
cfoutput lists all rows properly, but the following code (in the
other app) only lists every other row of the query result set, for
some reason:
<cfselect name="Record_Group" multiple="no" size="4"
required="yes" message="Select a Record Group...">
<cfoutput query="RecordGroupQ">
<cfif
compare(#RecordGroupQ.RecordNum#,#Edit_origQ.acc_num#) eq 0>
<option value="#RecordGroupQ.RecordNum#"
selected>#RecordGroupQ.RecordNum#</option>
<cfelse>
<option
value="#RecordGroupQ.RecordNum#">#RecordGroupQ.RecordNum#</option>
</cfif>
</cfoutput>
</cfselect>
The query is in the <head>, and is:
<cfquery name="RecordGroupQ" datasource="arch_card">
SELECT RecordNum FROM RecordGroups ORDER BY RecordNum ASC;
</cfquery>
Has anyone seen anything like this before?
Thanks,
Jason

Dan Bracuk wrote:
> As an aside, you don't want semi-colons in cfqueries.
that's interesting... why is that so? i have been wondering
about
semi-colons lately myself, but could not find a definite
explanation/rule/guide/best practice on whether to use them
or not...
could you please explain, Dan?
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

Similar Messages

  • Html query report /every other row grey

    Hello
    i have this query to html report
    do you know how to make every other row grey in the out pu of
    the query.
    and where do i put it in this code below?
    thanks in advance
    <cfquery name="GetCompanies"
    datasource="#Request.MainDSN#">
    SELECT
    CompanyID,
    CompanyName,
    Address,
    City,
    State,
    ZipCode,
    Comments
    FROM
    Company
    ORDER BY
    CompanyName ASC
    </cfquery>
    <html>
    <head>
    <title>ColdFusion MX Bible</title>
    <link rel="stylesheet" href="styles.css">
    </head>
    <body>
    <h1>Company List</h1>
    <TABLE width=100% align="left" border="4" rules="all">
    <tr>
    <td><b>ID</b></td>
    <td><b>Name</b></td>
    <td><b>Address</b></td>
    <td><b>City</b></td>
    <td><b>State</b></td>
    <td><b>ZIP Code</b></td>
    <td> </td>
    </tr>
    <cfoutput query="GetCompanies">
    <tr>
    <td>#CompanyID#</td>
    <td>#CompanyName#</td>
    <td>#Address#</td>
    <td>#City#</td>
    <td>#State#</td>
    <td>#ZipCode#</td>
    <td>
    <a
    href="EmployeeList.cfm?CompanyID=#CompanyID#">Employees</a>
    <a href="CompanyAddForm.cfm">Add</a>
    <a
    href="CompanyEditForm.cfm?CompanyID=#CompanyID#">Edit</a>
    <a
    href="CompanyDeleteForm.cfm?CompanyID=#CompanyID#">Delete</a>
    </td>
    </tr>
    </cfoutput>
    </TABLE>
    </body>
    </html>

    The fastest, but crudest and ugliest.
    <cfoutput query="GetCompanies">
    <tr #IIF(GetCompanies.CurrentRow MOD
    2,DE(''),DE('backgroundColor="##999"'))#>
    kellyhondalovesmusic wrote:
    > Hello
    > i have this query to html report
    > do you know how to make every other row grey in the out
    pu of the query.
    > ??
    >
    >
    > and where do i put it in this code below?
    >
    >
    >
    > thanks in advance
    >
    >
    >
    > <cfquery name="GetCompanies"
    > datasource="#Request.MainDSN#">
    > SELECT
    > CompanyID,
    > CompanyName,
    > Address,
    > City,
    > State,
    > ZipCode,
    > Comments
    > FROM
    > Company
    > ORDER BY
    > CompanyName ASC
    > </cfquery>
    >
    > <html>
    > <head>
    > <title>ColdFusion MX Bible</title>
    > <link rel="stylesheet" href="styles.css">
    > </head>
    >
    > <body>
    >
    > <h1>Company List</h1>
    >
    > <TABLE width=100% align="left" border="4"
    rules="all">
    > <tr>
    >
    > <td>
    ID</td>
    > <td>
    Name</td>
    > <td>
    Address</td>
    > <td>
    City</td>
    > <td>
    State</td>
    > <td>
    ZIP Code</td>
    > <td> </td>
    > </tr>
    > <cfoutput query="GetCompanies">
    > <tr>
    >
    > <td>#CompanyID#</td>
    > <td>#CompanyName#</td>
    > <td>#Address#</td>
    > <td>#City#</td>
    > <td>#State#</td>
    > <td>#ZipCode#</td>
    > <td>
    > <a
    href="EmployeeList.cfm?CompanyID=#CompanyID#">Employees</a>
    > <a href="CompanyAddForm.cfm">Add</a>
    > <a
    href="CompanyEditForm.cfm?CompanyID=#CompanyID#">Edit</a>
    > <a
    href="CompanyDeleteForm.cfm?CompanyID=#CompanyID#">Delete</a>
    > </td>
    > </tr>
    > </cfoutput>
    > </TABLE>
    >
    > </body>
    > </html>
    >
    >

  • Every other row (background color)

    I want to keep it simple and in css.  How can I get this to work properly so every other row has a yellowish background color with no gaps between the words.
    This is what I have but its producing an odd result.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
        margin: 0px;
        padding: 0px;
    div#footer{
        height:auto;
        background-color:green;
        clear:both;
        font-size:14px;
        width:800px;
    div#footer ul{
            margin:0;
            padding:0;
            list-style:none;
    div#footer li{
        width:155px;
        display:inline-block;
        text-align:center;
        vertical-align: top;
    /* horizontal line breaks */
    hr {
        border: 0;
        color: #323232;
        background-color: #323232;
        height: 1px;
        width: 95%;
        text-align: center;
    .even {
        background-color: #FF9;
    </style>
    </head>
    <body>
    <div id="footer">
            <ul>
            <li class="even">01/15/2011</li>
            <li class="even">Broadway Brewhouse</li>
            <li class="even">New Phila, OH</li>
            <li class="even">10pm</li>
            <li class="even">330-343-9231</li>
            <hr />
            <li>06/11/2011</li> <li>Edelwiess Inn</li> <li>Sugarcreek, OH</li> <li>10pm</li> <li>330-852-3750</li>    
            <hr />
            <li class="even">04/09/2011</li>
            <li class="even">Uhrichsville Moose Lodge (Open to the Public)</li>
            <li class="even">Uhrichsville, OH</li>
            <li class="even">TBD</li>
            <li class="even">740-922-9098</li>
            <hr />
            <li>01/15/2011</li> <li>Broadway Brewhouse</li> <li>New Phila, OH</li> <li>10pm</li> <li>330-343-9231</li>   
            </ul>
    </div>
    </body>
    </html>

    To create coloured backgrounds to every other row use this.
    #averages tr:nth-of-type(odd) {
      background-color:#ccc;
    Substitute the id of your table for mine and change the colour code to suit.

  • Does anyone knows how to highlight every other row in numbers mac

    Does anyone knows how to highlight every other row in numbers and are there any good tutorials out there???

    Hi Lee,
    Select a non-header cell in the table.
    Open the Inspector and choose the Table Inspector.
    Click to check the 'Alternating Row Color' box in the Cell Background section.
    Click the Color well beside the check box to open the Color pane.
    Choose a colour.
    The alternating colours are applied only to the non-header rows and non-header columns in your table.
    Regards,
    Barry

  • Delete every other row

    How can I automatically delete every other row in a Numbers spreadsheet?

    Thanks a lot.
    It's what we spell "Un rang sur deux".
    Automatic translator just replaced Engish words by French ones returning :
    Chaque autre rangée
    or
    toutes les autres lignes
    which had really no link with even/odd.
    It's a nice day, not only the sun shine but I learnt something new
    Yvan KOENIG (VALLAURIS, France) mardi 9 août 2011 16:42:55
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Looping through text files loads all 2014 files correctly, but 2013 files only loads every other row

    Hello all. I am once again stumped and would very much appreciate any help.
    I have a folder with many text files such as this...
    A 2013-03-31.txt
    A 2013-06-30.txt
    A 2013-09-30.txt
    A 2013-12-31.txt
    A 2014-03-31.txt
    A 2014-06-30.txt
    A 2014-09-30.txt
    B 2013-03-31.txt
    B 2013-06-30.txt
    B 2013-09-30.txt
    B 2013-12-31.txt
    B 2014-03-31.txt
    B 2014-06-30.txt
    B 2014-09-30.txt
    …and so on…
    and I'm loading all of the files beginning with A to an existing table in SQL Server. I'm loading the data as is to a staging table, no data type conversions, and I add only two derived columns. I have a loop to accomplish this, and it's working perfectly
    except for one detail. All of the files in 2013 load every other row. All of the 2014 files load all rows as intended.
    Any idea what would cause this? All files are being loaded using the same loop, same variables, same everything. My enumerator on the for each loop is Foreach File. The DataRowsToSkip property on the flat file connection manager is 0. I'm not sure where
    to look next. I need all rows in all files to be loaded.
    Forgot to mention that there is a difference between the 2013 and 2014 files. The 2014 files have 8 additional columns. I suspect this is causing my issue, just not sure what to do about it.
    Thanks for any help you can provide!
    WeeLass

    In SSIS 2012 and above these additional columns would not cause a failure, but looks like lead to you having impartial loads.
    I suggest you create two loops, one for one metadata - files from 2014 and another for 2013 ones.
    Arthur
    MyBlog
    Twitter

  • How to make the shade for every other row?

    Hi,
    i want the rows in my report dispalyed as:
    row1: gray
    row2: white
    row3: gray
    row4: white
    row5: gray
    thanx

    Hello,
    Highlight every alternate row
    Highlight every alternate row
    Regards

  • Script to automate every other row

    I am doing a large pricing catalog. I am linking my customer's Excel files to my InDesign CS4 tables. Every part of the table is formatted with cell styles. The first row has a .25 pt. rule below and the 2nd row has a 1 pt rule and it continues like this throughout the entire table. Some of the text is flush left, some center. I'd like to highlight an entire column, then run a script so this is automated. Is it even possible?
    I've attached a small example of one of my tables in case I haven't explained this well.
    Thank you

    It's certainly possible.
    I am a bit confused why you want to do this column-by-column, since your example appears to have uniform rows.
    var i, r=app.selection[0].cells;
    for (i=1; i<r.length; i+=2) {
        r[i].cells.everyItem().appliedCellStyle="Cell Style 3";
    That was originally written with the "cells" in the first line as "rows" (hence the variable r). But this loops over all the cells in the selection [a column], and applies a cell style (Cell Style 3) for each one that is odd-numbered (where the first cell is zero and thus even). You could modify individual attributes instead of using a style, but that seems inadvisible.
    You do have to watch out for the fact that the upper rule of one cell is the lower rule of another, so the order of applied cell styles can matter in terms of which rule is visible.
    If you want it to operate on entire rows of the selected table, swap out "cells" for "rows" in the first line.
    Hope that's useful. If not, please be more specific in what you would like the script to do.

  • When using FullRowSelect in a DataGridView, is there a way to not have it unselect every other row if you click on a row that is already selected?

    I want to do this for Dragging and Dropping multiple rows purposes. After the user selects multiple rows they expect to be able to click on one of those rows to start a drag and drop for all of them. Now, I have to tell them when they select the last
    row, they need to keep the mouse button down and then start the drag which nobody is used to.
    Thanks,
    Jim Welch

    I want to do this for Dragging and Dropping multiple rows purposes. After the user selects multiple rows they expect to be able to click on one of those rows to start a drag and drop for all of them. Now, I have to tell them when they select the last
    row, they need to keep the mouse button down and then start the drag which nobody is used to.
    Thanks,
    Jim Welch
    Hello Jim,
    The way you suggested the user is common way to select and drag, where will these selected rows dragged to?
    If possible, you could consider adding a button to move these rows to target control instead of letting user drag and drop manually.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to read a text file and only output every other line?

    I am just writing a program that reads a file but outputs only every other line. Any ideas...please? thanks

    I'd start with something like this and expand on it as you go:
    File file = <whatever>;
    BufferedReader in = null;
    try {
        in = new BufferedReader(new FileReader(file));
        int i = -1;
        for (String line = null; (line = in.readLine()) != null; ) {
            if ((++i % 2) == 0) {
                System.out.println(line);
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        if (in != null) {
            try {
                in.close();
            } catch (IOException e) {
    }Shaun

  • Iterating through every other (or specified number) of element in an array using a for loop

    I am trying to go through an array but instead of autoindexing I want to skip every other element or maybe a number of elements that will be specified for the user.
    Basic functionality that I want to acheive is the following in C code.
    int temp_var = 10;
    int i=0;
    for(i=0; i<=1000; i=i+temp_var)
    I am very new to LabVIEW and I did not know how to use internal variables.
    Can this be acheived using shift registers?
    I am attaching the code I currently have for this. Let me know what you think.
    Thanks guys.
    Solved!
    Go to Solution.
    Attachments:
    24_Sep_NchanNSamp.vi ‏44 KB

    tbob wrote:
    I have been asking for a new For Loop style that would allow us to specify start, stop, and step conditions, but it seems that many people are just not for this idea.  Don't know why?
    See here.
    I wouldn't say there aren't many people for it.  The idea you linked to was one of a half dozen of basically duplicate ideas, including another one of your own.
    These two ideas have a fairly large number of kudoes showing people want the idea.
    Smart Iterators with Loops
    For Loop Increment

  • Query results:every other record/row grey and white

    Hello guys,
    query results:every other record/row grey and white
    how would you make every other record/rows a different color
    just like the forums color. Lightest grey and white?
    <cfquery name="Myqueryname"
    datasource="#Request.MainDSN#">
    SELECT
    CompanyID,
    CompanyName,
    Address,
    City,
    State,
    ZipCode,
    Comments
    FROM
    Company
    ORDER BY
    CompanyName ASC
    </cfquery>
    <html>
    <head>
    <title>CF TUTORIALS</title>
    <link rel="stylesheet" href="styles.css">
    </head>
    <body>
    <h1>All CO Listings</h1>
    <table>
    <tr>
    <td><b>ID</b></td>
    <td><b>Name</b></td>
    <td><b>Address</b></td>
    <td><b>City</b></td>
    <td><b>State</b></td>
    <td><b>ZIP Code</b></td>
    <td> </td>
    </tr>
    <cfoutput query="Myqueryname">
    <tr>
    <td>#CompanyID#</td>
    <td>#CompanyName#</td>
    <td>#Address#</td>
    <td>#City#</td>
    <td>#State#</td>
    <td>#ZipCode#</td>
    <td>
    <a href=" ALL Emps.cfm?CompanyID=#CompanyID#">ALL
    Emps</a>
    <a href=" AddCO Form.cfm">AddCO</a>
    <a href="
    Editco.cfm?CompanyID=#CompanyID#">Editco</a>
    <a
    href="CoDeleteForm.cfm?CompanyID=#CompanyID#">Delete</a>
    </td>
    </tr>
    </cfoutput>
    </table>
    </body>
    </html>

    There is a cool tool in Coldfusion called MOD
    This basically calculates the remainder of the row number
    when divided.
    I interpreted its use to something like this, which has
    worked for me.
    <cfoutput query="qry_requestedlist" maxrows="30"
    startrow="1">
    <cfset EvenRow=#CurrentRow# +1>
    <cfif CurrentRow Mod 2 IS 1>
    <tr>
    <th class="grey" CurrentRow#</th>
    <cfelse>
    <th class="white">#CurrentRow#</th>
    <tr>
    </cfif>
    </cfoutput>
    I doubt this is precisely what you want but this is the sort
    of thing.

  • Spooling the output of a Query with out displaying the rows

    Hello All,
    Is it possible to spool the output of
    a query/dbms_output.put_line with out displaying
    the Query output on the console.
    In my case,list of rows in the output is huge, I want
    to eliminate displaying the output of query
    so that spooling will complete faster.
    Thanks in advance.
    -Srini

    You can do:
    SET TERMOUT OFFIn your script before doing the spool command.
    You will have to write your query as a .SQL script and run it from SQL*Plus in order for it to work the way you expect.
    sqlplus -s username/password @query_script.SQL

  • Outputing Total Numbers of Rows Returned in query using a CTE

    The query below is not being parsed by SQL Server and I can understand that the column name needs to be aliased which I have equally done. The idea behind the query is to output the count of rows using a CTE.
    USE AdventureWorks2012
    DECLARE @TotalRows INT = 0 -- OUTPUT
    WITH Invoice AS (
    SELECT @TotalRows = COUNT(CustomerID)
    , SalesOrderID
    , CustomerID
    , OrderDate
    FROM Sales.SalesOrderHeader
    WHERE OrderDate = '2007/07/01'
    GROUP BY SalesOrderID
    , CustomerID
    , OrderDate
    SELECT c.CustomerID
    , Invoice.SalesOrderID
    , Invoice.OrderDate
    FROM Sales.Customer AS c
    INNER JOIN Invoice
    ON c.CustomerID = Invoice.CustomerID
    ORDER BY Invoice.OrderDate DESC;
    How do I modify the query to produce the desired retult?
    Thank you.
    Zionlite

    Zionlite,
    check this>?
    DECLARE @TotalRows INT = 0 -- OUTPUT
    ;WITH Invoice AS
    SELECT COUNT(CustomerID) over()
    as customer_count
    , SalesOrderID
    , CustomerID
    , OrderDate
    FROM Sales.SalesOrderHeader
    WHERE OrderDate = '2001/07/01'
    GROUP BY SalesOrderID
    , CustomerID
    , OrderDate
    SELECT c.CustomerID
    , Invoice.SalesOrderID
    , Invoice.OrderDate
    , customer_count
    FROM Invoice
    LEFT JOIN Sales.Customer AS c
    ON c.CustomerID = Invoice.CustomerID
    ORDER BY Invoice.OrderDate DESC;
    So the above query, gives you the rows_count as a seprate column itself. Now you may use this to update the variable by pushing the results to  a temp table and selecting the column value.
    Method 2:
    Another method can be using the rowcount method..
    DECLARE @TotalRows INT = 0 -- OUTPUT
    ;WITH Invoice AS
    SELECT SalesOrderID
    , CustomerID
    , OrderDate
    FROM Sales.SalesOrderHeader
    WHERE OrderDate = '2001/07/01'
    GROUP BY SalesOrderID
    , CustomerID
    , OrderDate
    SELECT c.CustomerID
    , Invoice.SalesOrderID
    , Invoice.OrderDate
    FROM Invoice
    LEFT JOIN Sales.Customer AS c
    ON c.CustomerID = Invoice.CustomerID
    ORDER BY Invoice.OrderDate DESC;
    select @totalrows=@@rowcount
    select @TotalRows
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • Suppress zero rows in the query output.

    Dear Experts,
    We executed a query. In the output the values are displayed based on a hierarchy on gl account.
    But in the output some rows dont have any values i.e 0 value. Still those rows are appearing in the report output.I want to
    supress entire row. How to supress the entire row if no value i.e zeros are appearing in the query output.
    Regards,
    Bhadri M.

    go to change mode of query
    in that set the query properties /go to the query property secreen
    in the "Display " tab set the supperssion as "active (all value=0)" and in structure properties select the check box "also use  zero suppression for strucure element"
    i think it will be help ful
    Edited by: Soma Venkateshwarlu on Aug 28, 2009 2:40 PM

Maybe you are looking for

  • Import Manager Issue

    Hi, I have a bunch of records which have similarities in the description field of the source file and I need to consolidate all such records and add a separate ID to all such records in a different field. Example data is like this. 1 Rajani Kumar 2 R

  • Problem in screen programming

    Hi All, I have created a PUSH-BUTTON on the screen. On that button I am displaying a ICON by using the ICON NAME (ICON_INSERT_ROW).  It is correctly displaying in while logging in with EN language.  If I login with PT language it is not displaying th

  • Solution Manager project export / import

    Hi, is there any possibility to export the project files from Solution Manager, change some data in an other program and then import them back to solution manager? This whole import/export process should work automatically. The entire thing is to avo

  • Timelines Out of Order On Play All

    I created a DVD with two timelines in Encore 1.0. I created the timelines in the order they need to play back. The resulting DVD reverses the order of the timelines and I can't understand why. I have chapters menu that works perfectly. Any help would

  • Help Needed "Camera not asking to use photo location when switched on"

    Hey guys, any help would be greatly appreciated. When I turn on my camera app it used to ask if I wanted to use the location. Now it does not, I am interested in seeing what I can do with the geotagging feature. I checked my settings, and use locatio