CurrentRow MOD

I use CurrentRow MOD for outout cfdirectory to 3 columns. Some of the columns 2 and 3 are not aligned to the top, did I miss something?

< table width = "800" cellspacing = "3" cellpadding = "3" >
< tr valign = "top" >
< cfoutput query = "pull_EMops" >
< CFIF year (pull_EMops.dateLastModified) EQ session. DispDate >
< cfset filename = replace(pull_EMops.name,".pdf","","ALL") >
"< td valign ="top"> < a href =" http://localhost/DocumentsRemote/EMops_Bulk/#pull_EMops.name# "> < police ="Tahoma"size ="2"> #filename # < /a > < br / >"
#dateformat(DateLastModified, "mm/dd/yyyy") # < / police > < table >
< cfif pull_EMops.CurrentRow IS 3 MOD 0 >
< /tr >
< b >
< / cfif > < / cfif >
< / cfoutput >
< /tr >
< /table >

Thanks for any help. Al

Wait, so is the problem of alignment of data within the cell or the arrangement of the cells within the table itself? If it's the latter, I think I see what is wrong.

OK, so I'm assuming you are trying to create a table that is three columns wide and you want all rows to be filled completely starting from the top. So, for example, if you have 4 cells in the table, you want to the top row filled with 3 cells and the bottom line to have a. However, what you see now is that line you can have 1 battery and two row could have 3, am I good?

The problem is that, because of your first statement, CurrentRow might not be a multiple of 3, once the code has entered the first if statement 3 times. For example, let's say that your first if the statement is false when CurrentRow = 1 and CurrentRow = 2 true but for CurrentRow = 3. It would follow that a table cellbefore you end the line and start a new line.

A way around this is to set a variable to keep track of how many cells have been created so far and set it to 0, once a line has been created. So... try this maybe.
















http://localhost/DocumentsRemote/EMops_Bulk/#pull_EMops.name# "> " #filename #.

#dateformat(DateLastModified, "mm/dd/yyyy") #.

Tags: ColdFusion

Similar Questions

  • MOD

    Hello

    I don't know that I'm not quite grasp the use of the MOD.

    I would like to do something with each 4th record and we tried < cfif currentRow MOD 4 > who gives me the first 3 of every 4, but not the 4th. I also tried < cfif NOT currentRow MOD 4 > gives me the 4th. Is there a betterway to do this using the MOD without using DO NOT?

    Thank you
    Paul

    > there difference between and ?

    Yes. mainly produces the results in front of

    The reason is that CF treats as a Boolean expression. If the returned value is 0, which translates as false. If the value is not 0, this means that the true.

    Then
    When the MOD returns 0 (IE, it's the 4th row), CF treats the expression as: ...
    Otherwise, CF treats her like: ...

  • Output and group records into several column format problem

    Hi all

    I'm banging my head on the wall with this one. I have a query that displays the result in the form of two columns, it works fine.

    I have a problem when I try to use "group"for the field DSC1 doesn't show duplicates."  He transforms the output in column 2, column 3 and column 4 spots white all along.

    Someone knows how can I get it to display 2 columns of output and does not show in double DSC1 fields? The following are examples of what is happening:


    1 example of what he does without group (note to Apple is twice, which is not):

    Apples apples

    Orange peaches

    banannas grapes

    What I need to do (only show each DSC1 once and continue with the format of two columns) :

    oranges apples

    Fisheries banannas

    grapes

    Here is the code I use:

    < cfquery name = "getProduct" datasource = "mydb" >
    SELECT * from ecitm
    WHERE DSC1 <>' '
    order by DSC1

    < / cfquery >

    <! - start the 2-column output table - >

    < table border = "0" width = "90%" border = "0" align = "center" cellpadding = "5" cellspacing = "5" >

    < cfset newrow = false

    < b >
    < cfoutput query = "getProduct" group = "DSC1" >

    < cfif newrow EQ "true" >
    < b >
    < / cfif >
    < td >
    #DSC1 #.
    < cfif DSC2 NEQ "" > "".
    < br >
    #DSC2 #.
    < / cfif >

    < br >
    < a href = "DetailsList.cfm? ID = #getProduct.ID # & litm = #getProduct.LITM #" > VIEW < /a > DETAILS
    < table >

    < cfif getProduct.currentRow MOD 2 EQ 0 >
    < /tr >
    < cfset newrow = true >
    < cfelse >
    < cfset newrow = false >
    < / cfif >


    < / cfoutput >
    < /tr >
    < /table >

    The currentRow always property will count the number or records in the record setting loop, if you their output or not.

    Since you are not the output values for each record in the Recordset, you must count the itterations yourself.

    Put a meter of itteration before the loop.

    Update the counter at the top of the loop.

    OR on newer versions of CF

    Reset the counter in the true clause of the block, where you also define new line. >

    Then use the variable in the iit instead the currentRow property to determine the number of items have been posted.

    **** OR ****

    You could do a simple SQL command does not get duplicates first and then use a loop of simple without any of the grouping and additional logic that you do.

    
    
    SELECT DISTINCT *
         FROM ecitm
         WHERE DSC1 <> ' '
         ORDER BY DSC1
    
    
    
    
         #DSC1#
         
    
        
    
    
    
  • Need help request! 2 tables

    Using Coldfusion 8 and MySQL.  I have 2 tables, one called products (100 points) and another table called Clearance (5 items).

    I see all 100 products and need to insert the discounted_price of the 5 elements of the game table in the query below.

    (* write it down field discounted_price only exists in the table).

    Also, how the returned below list can mark the checkboxes of the 5 elements of the game table.

    (* note-productid is used in both tables. I guess you could call it the foreign key between tables).

    I am a newbie and not sure how to write queries.  Any help would be appreciated.  Thanks in advance.

    < cfoutput query ="getProducts">

    < tr< cfif currentrow mod 2> class = 'weird'< / cfif >>

    < td >< div align ="left">< entry type ="checkbox" name ="promo" value ="#">< table >

    < td > (#getProducts.modelnumber #) #getProducts.modelnumber #< table >

    < td >#getProducts.modeldescription #< table >

    < td >#getProducts.category #< table >

    < td >#getProducts.subcategory #< table >

    < td > < input type ="text" name ="discounted_price" Value ="">< table >

    < /tr >

    < / cfoutput >


    Select p.modelnumber, p.modeldescription, p.category, p.subcategory, C.discounted_price
    left join products P C release on C.productid = P.productid

    <>class = 'weird'>

    checked >

    #getProducts.modelnumber # (#getProducts.modelnumber #)

    #getProducts.modeldescription #.

    #getProducts.category #.

    #getProducts.subcategory #.

    I hope this helps...

  • Enter in the input area, output of the query / report of the AN_id, to query/display page.

    Hello
    I tried to create a text input area to enter a type of alphanumeric data, however it does not work for me again.
    Can someone help me here is the new code 2, I added to my query results.
    Basically, I have 2 pages
    One is the entry (index)
    And the other is where is the logic. / query

    I was working on a fifth Query but now since I added the code. It doesn't yet?
    Can someone help me?
    Thank you.
    And thank you

    In the box, I have this in the index.cfm

    < label > enter AN ID
    < input type = "text" name = "AN_ID" / >
    < / label >

    In where clause is what I have the requests page or

    AN_ID = ' #form. "AN_ID #

    Here is the code:

    index page

    Sort by:
    < select name = "Orderby" size = "1" >
    < option value = "AN_ID" > YEAR ID < / option >
    < option value = "AN_DATE" > a DATE < / option >
    < / select >
    < br / >
    < br / >
    Output format:
    < input type = "radio" name = "outputFormat" value = "HTML" checked = "checked" / >
    HTML
    < input type = "radio" name = "outputFormat" value = "PDF" / >
    PDF
    < input type = "radio" name = "outputFormat" value = "CSV" / >
    Download/open Excel Spreadsheet < BR / >
    < BR / >
    < /p >
    < / make >
    < p > < / p >
    < / div >

    < form id = "form1" name = "form1" method = "post" action = "" >
    < label > enter AN ID
    < input type = "text" name = "AN_ID" / >
    < / label >
    ----------------------------------------------------------------------------------------- ------------------------------------------------------------

    the query page and view the page


    < cfquery name = "getHIPPOcases" datasource = "oracle10" >
    Select
    Thecasertab.AN_ID as AN ID
    Thecasertab.AN_DATE as a date
    Thecasertab_requi.case_requi_id
    Thecasertab_requi.requi_type_cd
    Thecasertab_requi. App_user_id


    Of
    thold_case
    tloc
    tla_prop
    Thecasertab
    tref_plan_area
    Thecasertab_requi

    where
    Thecasertab_requi.caser_id = Thecasertab.caser_id
    and
    thold_case.caser_id = Thecasertab.caser_id
    and
    AN_ID = ' #form. "AN_ID #



    order by

    < cfswitch expression = "#Form.orderBy #" >
    < cfcase value = "AN_ID" >
    CASE. AN_ID
    < / cfcase >
    < cfcase value = "AN_DATE" >
    CASE. AN_date
    < / cfcase >
    < / cfswitch >


    < / cfquery >


    <! - report html - >
    < cfswitch expression = "#Form.outputFormat #" >
    < cfcase value = "HTML, PDF" >

    < cfsavecontent variable = "htmlData" >
    <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" " 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 = iso-8859-1 "/ >"
    getHIPPOcases < title > < /title >
    < / head >
    < style type = "text/css" >

    TD {}
    do-family: Arial, Helvetica, without serif.
    do-size: 12px;
    }
    Th {}
    do-family: Arial, Helvetica, without serif.
    do-size: 12px;
    make-weight: bold;
    background-color: #FFFF99;
    }
    H2 {}
    do-family: Arial, Helvetica, without serif.
    do-size: 14px;
    }
    H3 {}
    do-family: Arial, Helvetica, without serif.
    font-size: 15px;
    }
    < / style >

    < body >
    < cfoutput >
    < table border = "0" cellpadding = "3" cellspacing = "0" >
    < b >

    < td align = "center" >
    getHIPPOcases < h3 > < / h3 > < br > < br > < table >
    < /tr >
    < b >
    < td align = "center" >
    < / h2 > your query returned #getHIPPOcases.RecordCount # entries < / h2 > < table >
    < /tr >
    < b >
    < td >
    < table border = "2" cellpadding = "2" cellspacing = "0" >
    < b >
    Number < /th > < th > Record
    < width th = "120" > YEAR ID < /th >
    date of YEAR < /TH > < TH >

    < /tr >

    < cfloop query = "getHIPPOcases" >


    < tr bgcolor = "< cfif currentrow mod 2 > F8F8FF < cfelse > WHITE < / cfif >" >
    < td > #CurrentRow # < table >
    < td > #AN_ID # < table >
    < td > #dateformat(AN_date,"mm/dd/yyyy") # < table >


    < /tr >
    < / cfloop >

    < /table >
    < table >
    < /tr >
    < /table >

    < / BODY >
    < / HTML >
    < / cfoutput >
    < / cfsavecontent >

    < cfswitch expression = "#Form.outputFormat #" >

    < cfcase value = "HTML" >
    < cfoutput >
    #htmldata #.
    < / cfoutput >
    < / cfcase >
    < cfcase value = "PDF" >
    PDF
    < cfdocument format = "pdf" >
    < cfoutput >
    #htmldata #.
    < / cfoutput >
    < / cfdocument >
    < / cfcase >

    < / cfswitch >





    < / cfcase >

    < cfcase value = "CSV" >


    < NAME CFHEADER = "Content-Disposition" VALUE = "attachment; filename = Citywide.csv">
    < cfcontent type = "application/msexcel" > "YEAR ID ', 'a date '.
    < cfoutput query = "getHIPPOcases" > #ltrim (AN_ID) #, "#dateformat(AN_date,"mm/dd/yyyy")" # ""
    < / cfoutput >


    < / cfcase >
    < / cfswitch >



    Quote:
    Posted by: briankind
    on the entry
    I get home an_id value let lov-1234-oop-ui
    and
    PRESST the button
    It's notreturn results (nothing happens)
    Thank you

    In this case, hard-code the value "lov-1234-oop-ui" in your query instead of the form variable. You get a result?

  • Alternate line color for the CF Builder report?

    I have a user who wants one of its reports to display line colors alternated for clarity of reading. The reports are quite long and the lines tend to blend in with eachother.

    The I have to handle this is to put a gray rectangle behind the values that spans the entire detail section. Then, in the section 'Print Control' of the 'Properties' toolbar, I'll put the equation 'request. CurrentRow mod 2 ''. In this way he band background will only color every two rows.

  • Formatting text in a cell (word Wrap)

    Here's the problem in a few words...

    I use the following table to enter a text entry in a field called "Techtext" in an Access database, type of data "Memo."

    < table width = "690" border = "1" cellspacing = "1" cellpadding = "3" >
    < b >
    < td width = "21" > < table >
    < td width = "20" > < table >
    < td width = "22" > < table >
    < td width = "588" > < strong > text < facilities > < table > input
    < /tr >
    < b >
    < height td = "189" > < label >
    < input name = "hiddenField_User" type = "hidden" id = "hiddenField_User" value = "" < CFOUTPUT > #Session.MM_Username # < / CFOUTPUT > "/ >"
    < / label > < table >
    < td > < label >
    < input name = "hiddenField_date" type = "hidden" id = "hiddenField_date" value = "< CFOUTPUT > #DateFormat (Now (), ' mm/dd/yyyy')" # < / CFOUTPUT > "/ >"
    < / label > < table >
    < td > < label >
    < input name = "hiddenField_pn" type = "hidden" id = "hiddenField_pn" value = "CFOUTPUT <>#URLDecode (URL." (# Numéro) < / CFOUTPUT > "/ >
    < / label > < table >
    < td > < label >
    < name textarea = 'TechText"cols ="85"lines ="25"wrap ="physical"id = 'TechText' > < / textarea >
    < / label > < table >
    < /tr >
    < /table >


    I'm trying to view this data (and others) in a table. The last line of the table is for the additive text view.
    It should show the value of "Textetexte" in the cell of the table. The problem is that the original data does not contain a carriage return, so data just bleeds off screen. Here is the code:

    < table width = "692" border = "1" cellspacing = "1" cellpadding = "3" >
    < cfoutput query = 'Support' >
    < cfif Support.currentrow mod 1 eq 1 >
    < tr > < tr > < td > < table >
    < / cfif >
    < td width = "136" > < strong > addendum Date: < facilities > < table >
    < td width = "535" > #Support.Date # < table >
    < /tr >
    < b >
    < td > < strong > addendum by: facilities > < table >
    #Support.User_Name # < td > < table >
    < /tr >
    < b >
    < td > < strong additive text >: < facilities > < table >
    < td width = "85" align = "left" > < div align = "left" > < span class = "style2" > #Support.TechText # </span > < / div > < table >
    < b >
    < td > < strong > < / strong > < table >
    < td > < table >
    < cfif Support.currentrow mod 1 eq 0 >
    < /tr >
    < / cfif >
    < / cfoutput >
    < /table >


    How can I get this data to display in 85 lines of character (basically adding a carriage return after each character 85). I searched on the net, but have found no solution. You can see the resulting table here: http://devo.dns2go.com/info.cfm?PartNumber=AH058AA

    Thank you in advance!

    Eric

    Thanks to Avatar for answering my question (Yes, I'm a fool!)
    You correct werr. My page was working properly, I used just bad results.

    In addition, thanks to Kapitaine for the alternative.

    Best regards

    Eric

  • Problem with my innerjoin. Help, please

    Hello;
    I try to write a complicated page and I get an error in my query. I have another question for this request that I can't seem to work, but lets make this one problem at a time.

    This is the error I get when you go directly to this page:
    Run database query error. [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver] Syntax error (missing operator) in a query expression 'Projects.CategoryID Categories.Name'.
    The error occurred on line 12.

    This is my code:
    <!-it's the query with the error, he manages the project files and either bring them all to the top or only those of the category chosen in another page. ->
    < cflock timeout = "10" type = "exclusive" scope = "application" >
    < name cfquery = "getProjects" datasource = "#APPLICATION.dataSource #" >
    SELECT Projects.Name AS PName, Projects.ProjectID AS ID, Projects.CategoryID
    Categories.Name AS CName, categories. CategoryID
    PROJECT INNER JOIN categories on projects. CategoryID = categories. CategoryID
    < cfif StructKeyExists (url, "CategoryID") >
    WHERE categories. CategoryID = < cfqueryparam CFSQLType = "CF_SQL_INTEGER" value = "#URL. "CategoryID #" / >
    AND categories. CategoryID = Projects.CategoryID
    ORDER BY Projects.Name
    < cfelse >
    ORDER BY Categories.Name
    < / cfif >
    < / cfquery >
    < cfset rowsPerPage = 6 >
    < name = "cfparam URL.startRow' default = '1' type 'number' = >"
    < cfset totalRows = getProjects.recordCount >
    < cfset EndRowOptional = min (URL.startRow + rowsPerPage - 1, totalRows) >
    < cfset startRowNext = EndRowOptional + 1 >
    < cfset startRowBack = URL.startRow - rowsPerPage >
    < / cflock >
    <! - end project file code - >
    <!-this code runs the success to update your #record #->
    < isDefined ("URL.ID") cfif >
    < name cfquery = "zlnbbXX" datasource = "" #APPLICATION.dataSource # "LignesMax ="1">"
    SELECT Projects.Name AS PName, Projects.ProjectID AS ID, Projects.CategoryID
    WHERE ProjectID = #URL.ID #.
    < / cfquery >
    < / cfif >
    <! - complete code - >
    < head >
    < / head >
    < body >
    <!--> code for success update record
    < cfif isDefined "(URL. RecordID") >
    < cfoutput query = "zlnbbXX" >
    < font color = "# 990000" face = "Verdana, Arial, Helvetica, sans-serif" size = "2" > < b > updates have been applied successfully to: < /b > < br > < u > #PName # < /u > < / police > < br > < / cfoutput > < / cfif >
    <!--> end success
    <!-records and next / prev nav-->
    < cfoutput >
    Display of < b > #URL.startRow # < /b > < b > #endRow # < /b > < b > #totalRows # < /b > Folders < / make >
    < cfset urlVars = "" > "".
    < cfif startRowBack GT 0 >
    < cfset urlVars = ' StartRowOptional = #startRowBack #">".
    < / cfif >
    < structKeyExists cfif (url, "categoryID") >
    < cfset urlVars = urlVars & "categoryID = #categoryID #" > ".
    < / cfif >
    < a href = "" #CGI.script_name #? #urlVars # "class ="nav"> < Previous Records < /a >"

    < cfset urlVars = "" >
    < cfif startRowNext lte totalRows >
    < cfset urlVars = ' StartRowOptional = #startRowNext #">".
    < / cfif >
    < structKeyExists cfif (url, "categoryID") >
    < cfset urlVars = urlVars & "categoryID = #categoryID #" > ".
    < / cfif >
    < a href = "" #CGI.script_name #? #urlVars # "class ="nav"> next > < /a >"
    < / cfoutput >
    <!-end next / prev code-->
    <!-edit-> documents
    (< cfloop query = "getProjects" StartRowOptional = "" #URL.startRow # "EndRowOptional =" #endRow #"> < cfset class = iif (getProjects.currentRow mod 2 eq 0,)" "DataUn'", "' DataB'") >
    < cfoutput >
    #PName #.
    #CName #.
    < name of the form = "myform" action = "Action.cfm" method = "post" > "
    < input type = "hidden" name = "ID" value = "#ID #" >
    < input type = "submit"... More code here >
    < / cfoutput >
    < / cfloop >


    This query does a few things.
    1. If you go directly to this page, it shows all the projects title so you can next / previous through records and change the recording you want.
    2. I'm doing so that if you come from another page that modifies all categories for this section, it will only bring up projects in this category. He has done this, but when you next / prev through it, it shows all the records.
    3. Once you add or update a record, where you are returned to this page, he tells you: "your updates were successful for the project #title #

    I've commented the code, I know there are some questions here and I need help their knowledge.

    CFmonger

    In the query "getProjects.

    Missing comma between, Projects.CategoryID Categories.Name AS CName, (no comma after CategoryID)
    The AND condition in the query is redundant, this is done in the join condition.
    For problem 2 without seeing the actual url, I can't help. But I would say that the catergoyid is not there

    There is no from clause in the query 'zlnbbXX'

    Ken

  • Repeating data sets

    Hello

    This has been driving me crazy! I want to display all the parts that have the same production, based on the following query:

    < name cfquery = 'Hand' datasource = 'Parts' username = "admin" password = "XXXXX" >
    SELECT Main_Table.Image_File, Main_Table.Part_Number, Contract_Table.Name_of_Contract, Main_Table.Quantity,
    Main_Table.Specific_Description, Nomen_Table.Generic_Nomen, MNFR_Table.Manufacture_Name,
    Vendor_Table.Vendor_Name, Main_Table.NEMS_Tag, Main_Table.Location
    Vendor_Table INNER JOIN (Nomen_Table INNER JOIN (MNFR_Table INNER JOIN (Contract_Table INNER JOIN Main_Table ON Contract_Table.Contract_num = Main_Table.Contract_num) WE MNFR_Table.MNFR_num = Main_Table.MNFR_num) WE Nomen_Table.Nomenclature_ID = Main_Table.Nomen_num) ON Vendor_Table.Vendor_num = Main_Table.Vendor_num
    WHERE (((Main_Table.MNFR_num) = #form.mnfr_lst #) AND ((Main_Table.Contract_num) = [Contract_Table]!) [Contract_num]) AND ((Main_Table.MNFR_num) = [MNFR_Table]! [MNFR_num]) AND ((Main_Table.Nomen_num) = [Nomen_Table]! [Nomenclature_ID]) AND ((Main_Table.Vendor_num) = [Vendor_Table]! [Vendor_num])) < / cfquery >

    It uses an Access database. (You can see the relationship of table here: http://spacecoasthomes.net/relation.jpg )



    However, when I view the page, I get cases of duplicated data. (Check it out on my test server, http://devo.dns2go.com/ )

    Select Hewlett Packard as the manufacter. It should return only 3 parts. However, it is to repeat the following fields:
    Main.Part_Number, Main.Quantity, Main.NEMS_Tag, Main.Specific_Description and Main.Location.


    Here is the table that I use to display the data:

    < table border = "0" cellpadding = "15" cellspacing = "0" bgcolor = "FFFFFF" >
    < cfoutput query = 'Hand' >
    < cfif Main.currentrow mod 3 eq 1 >
    < b >
    < / cfif >
    < td >
    < p > < cfoutput > < img src = "" images / #Main.Image_File # "width ="150"> < / cfoutput > < / p >"
    < p > < span class = "style1" > part number: </span > < cfoutput > < span class = "style1" > < cfoutput > #Main.Part_Number # < / cfoutput > < / span > < / cfoutput > < br / >
    < span class = "style1" > contract: </span > < cfoutput > < span class = "style1" > #Main.Name_of_Contract # </span > < / cfoutput > < br / >
    < span class = "style1" > </span > quantity: cfoutput > < cfoutput > < span class = "style1" > #Main.Quantity # </span > < / cfoutput > < / cfoutput > < br / >
    < span class = "style1" > specific Description: </span > < cfoutput > < cfoutput > < span class = "style1" > #Main.Specific_Description # </span > < / cfoutput > < / cfoutput > < br / >
    < span class = "style1" > Nomenclature: </span > < cfoutput > < span class = "style1" > #Main.Generic_Nomen # </span > < / cfoutput > < br / >
    < span class = "style1" > manufacturer: </span > < cfoutput > < span class = "style1" > #Main.Manufacture_Name # </span > < / cfoutput > < br / >
    < span class = "style1" > main provider: </span > < cfoutput > < span class = "style1" > #Main.Vendor_Name # </span > < / cfoutput > < br / >
    < span class = "style1" > NEMS Tag: </span > < cfoutput > < cfoutput > < span class = "style1" > #Main.NEMS_Tag # </span > < / cfoutput > < / cfoutput > < br / >
    < span class = "style1" > location (Cage/rank): cfoutput > < cfoutput > #Main.Location # < / cfoutput > < / cfoutput > < / span > < br / >
    < /p > < table >
    < cfif Main.currentrow mod 3 eq 0 >
    < /tr >
    < / cfif >
    < / cfoutput >
    < /table >

    I know that the dataset is correct because I tested the return dataset (using the < cfdump var = "#Main #" >) that checks the correct data (you can see here):
    ( http://spacecoasthomes.net/dataset.jpg )

    I tried many different forms of the same query, nested queries and joins. Any help would be appreciated to grealty!

    Eric


    Problem has been resolved. For the benefit of others reading this thread, here's what happened:

    The changes to the SQL by Dan Bracuk (thanks!)
    Everything isn't the problem, it makes it easier to follow.

    The problem is in the display table code. Look at the original code:








    Part Number: #Main.Part_Number #

    Contract: #Main.Name_of_Contract #

    Quantity: #Main.Quantity #

    Specific description: #Main.Specific_Description #

    Nomenclature: #Main.Generic_Nomen #

    Manufacturer: #Main.Manufacture_Name #

    Main provider: #Main.Vendor_Name #

    NEMS Tag: #Main.NEMS_Tag #

    Location (Cage/line): #Main.Location #






    Look at all those tags! No wonder it was the impression of duplicate fields.

    Redid the code and works fine! Necessary only a set of these tags for all of the outputs.
    Corrected following code:













    Part Number: #Main.Part_Number #

    Contract: #Main.Name_of_Contract #

    Quantity: #Main.Quantity #

    Specific description: #Main.Specific_Description #

    Nomenclature: #Main.Generic_Nomen #

    Manufacturer: #Main.Manufacture_Name #

    Main provider: #Main.Vendor_Name #

    NEMS Tag: #Main.NEMS_Tag #

    Location (Cage/line): #Main.Location #.

    Thank you!

    Eric

  • Line color Alt in grouped output

    I have always used the following code to the colors of the other line in a CFOUTPUT table:

    < tr bgcolor = "#IIf (query.currentRow Mod 2, DE('cfcfcf'), DE('eeeeee')) #" >

    However, when I use this code in a table with a group outing, I get unpredictable line colors. For example, the first two lines will be color1, the next two color2, then the next few lines will be displayed in alternation as I want.

    I enclose the code that I currently train.

    Any ideas how to get line alt colors to display properly? Thanks in advance...

    Sorry, my initial search to find the answer came up to nill. When I tried again I found the answer which I'm pasting below. It was working fine.

    ===========================================================================
    When you use the CFOUTPUT GROUP attribute, your data is no longer in the same order in which it was recovered. the CURRENTROW variable is no longer in chronological order (you display the first element grouped, then 1-n members of this group, then repeat).

    You must define an iteration variable.



    (now use 'myRowCountVar' to the key off to determine the color of background rather than currentrow)

    troublemaker of Charlie (CJ)
    http://Charlie.griefer.com
    @ #coldfusion / DALnet
    =================================================================================

  • function of group in coldfusion

    Hello do anyone know how to use the Group feature in coldfusion
    My paintings that puts off an html tag
    is outputing multiple CEENO

    for example CEENO
    11111
    11111
    11111
    11111

    someone here said to use the Group feature in coldfusion
    do you know where I can put?




    < table border = "2" cellpadding = "2" cellspacing = "0" >
    < b >
    Number < /th > < th > Record
    < TH > PEA_id < /TH >
    < width th = "120" > CEENO < /th >
    Address < TH > < /TH >

    ZipCode < TH > < /TH >

    AdvisoryDate < /th > < th >






    < /tr >

    < cfloop query = "getthecases" >


    < tr bgcolor = "< cfif currentrow mod 2 > F8F8FF < cfelse > WHITE < / cfif >" >
    < td > #CurrentRow # < table >
    < td > < table > #PEA_id
    < td > #CEENO # < table >
    < td > #ST_NO # #ST_initial # #st_dir # < table >
    < td > #ZipCode # < table >





    < td > #dateformat(ADVISORY_DATE,"mm/dd/yyyy") # < table >









    < /tr >
    < / cfloop >

    < /table >

    Try this:


    #CurrentRow #.
    #PEA_id
    #CEENO #.
    #ST_NO # #ST_initial # #st_dir #.
    #ZipCode #.
    #dateformat(ADVISORY_DATE,"mm/dd/yyyy") #.

  • Alternation of colors in a picture

    I put together a page displays generated dynamically to HTML tables.

    There are three paintings of the page that is generated from the same database but I can't seem to find a way to generate the alternating line colors. I'm trying to use:
    < CFOUTPUT QUERY = "GetTableData" >
    < TR BGCOLOR = "# IIF(GetTableData.currentrow MOD 2, DE ('E6E6E6'), DE('C0C0C0')) #" >

    but line colors are grouped to make 2 or 3 ranks are the same color and then maybe 5-6 are the other color. There is no consistency.

    Anyone have any ideas on how to solve this problem?

    Thank you for all the answers. I took the advice of cf_dev2 ran three separate petitions and usedfor lines alternate. The problem was that all ranks was questioned but not displayed.

  • ValueList

    I have the valuelist below:

    #valuelist (qryGet_upload_Files.upload_file_name, ",") < cfoutput > # < / cfoutput >

    How can I have a picture on the top of each list, so the output looks like this: (O represents an image)?

    O O
    List 1, list 2,... etc.

    Also, I work with a small space. How the list may be limited to 5-10 per line (with the image on the top) and then switch to the
    the next line and continue, etc. ?

    Its probably more work to try to use valueList. Why not just loop through the query, using CurrentRow MOD 5 to insert a line break all the 5 elements?

  • Generation of a table (from database)?

    Hi all

    I have the code below to the post build (and fill) a 'html' in a database table.
    The table is the accumulation of left to right like this:
    A | B | C
    D | E | F
    G | H | I have

    Now, I would do the same thing, but NOT from left to right and from top to bottom:
    A | D | G
    B | E | H
    C | F | I have

    The right amount of cells (rows) remains 3. From the top to the bottom (columns) is 14 years at present, but could vary.
    Someone here who might have a suggestion on how to do it?

    Thank you.

    -code-
    < cfquery name = "ListCategory" datasource = "theDB" >
    SELECT *.
    CATEGORY
    ORDER BY categoryNAME ASC
    < / cfquery >


    < table width = "800" border = "0" cellspacing = "0" cellpadding = "0" >
    < tr > < cfoutput query = "ListCategory" >
    < td > #categoryNAME # < table > < cfif IS ListCategory.CurrentRow MOD 3 0 >
    < /tr >
    < tr > < / cfif > < / cfoutput >
    < td > < table >
    < /tr >
    < /table >

    Here's an idea for every reference of a cell. Completely new once again
    and untested.






    #listCategory.categoryName [r] #.
    #iif (r + divider LT listCategory.recordCount,
    DE(listCategory.CategoryName[r+Divisor]), OF (")) #.
    #iif (r + divisor * 2 LT listCategory.recordCount,)
    DE(listCategory.CategoryName[r+Divisor*2]), OF (")) #.



  • CFLoop problem

    Hello

    I am filling a two-column table with the data from my database from left to right.

    I have it almost working except that customer fills even the columns and the code has created the following line and recorded the same thing with the other... This is the case with all the records in the query.

    You can view the page at the following URL: http://test.cooperstown.com/attractions.cfm.

    --------------------------------------------------------------------


    Here's a better approach: MOD operator allows you to check if the current Web request
    is even or odd - if even insert yourto start the new line. no need
    for the additional line counter variable:









    getListingInfo.currentrow MOD 2 est0 >





    Attractions

    #getListingInfo.BName #.

    #getListingInfo.City #, #getListingInfo.State #, #getListingInfo.Zip #.<>
    / > #getListingInfo.PhoneNum #.


    Guide,[email protected]">#getListingInfo.Email #.


    target = "_blank" > #getListingInfo.BName # website


    Azadi Saryev
    SABAI - Dee.com
    http://www.SABAI-Dee.com/

Maybe you are looking for