Display vertical line or pipe if not equal torecordcount

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

  1. #1

    Default Display vertical line or pipe if not equal torecordcount

    Hi,

    I would like to display the following cities categorized by region name
    separated by vertical line or pipe like our forums menu above. My problem is
    very simple if I do it in HTML but when I do it with my dynamic query I have
    having an extra vertical line or pipe after the cities if another region is
    displayed. Can anyone help me with my problem?

    Desired output:
    Arizona Find courses in Phoenix/Scottsdale | Tucson Area
    California Find courses in Los Angeles Area | Orange County
    Carolinas Find courses in Charleston | Charleston
    Florida Find courses in Jacksonville/ St. Augustine | Miami to Fort Lauderdale
    | Naples to Ft. Myers | Orlando

    Here the code that keeps giving me extra vertical line or pipe:

    <cfquery name="getCountryRegions" datasource="#dsn#">
    SELECT sr.rname, cr.crName, sr.riD AS RegionID, crg.countryRegionID,
    sr.stateID, count(crg.regionID) AS ridCount
    FROM CountryRegionsGroup crg
    LEFT OUTER JOIN stateRegions sr ON crg.regionID = sr.rID
    LEFT OUTER JOIN countryRegions cr ON crg.countryRegionID = cr.countryRegionID
    WHERE cr.active = 1
    AND sr.active = 1
    GROUP BY sr.rname, cr.crName, sr.riD, crg.countryRegionID, sr.stateID,
    CRG.stateID, crg.regionid
    ORDER BY cr.crName
    </cfquery>

    <cfset count = 0>
    <cfset ridCount = 0>
    <cfoutput query="getCountryRegions" group="countryRegionID">
    <cfquery name="getCount" dbtype="query">
    SELECT countryRegionID AS cityCount
    FROM getCountryRegions WHERE countryRegionID =
    #getCountryRegions.countryRegionID#
    </cfquery>
    <cfquery name="getC" datasource="#DSN#">
    SELECT countryRegionID, regionID, count(regionID) AS ridCount
    FROM CountryRegionsGroup WHERE countryRegionID =
    #getCountryRegions.countryRegionID#
    GROUP BY countryRegionID, regionID
    </cfquery>


    <div class="destTitle"><a
    href="region_index.cfm?SRID=#getCountryRegions.cou ntryRegionID#&RegionName=#getC
    ountryRegions.crName#" class="arial12">#getCountryRegions.crName#</a></div>
    <div>Find courses in
    <ul>
    <li><cfoutput group="regionID"><cfset ridCount =
    getCountryRegions.ridCount + 1>&nbsp;<a
    href="city_index.cfm?rid=#getCountryRegions.region ID#&stateID=#getCountryRegions
    ..stateID#&SRID=#getCountryRegions.countryRegionID #">#getCountryRegions.rName#
    d:#ridCount# </a><cfif ridCount NEQ
    getC.RecordCount>&nbsp;|</cfif></cfoutput></li>
    </ul>
    </div>
    <br clear="left" />
    </cfoutput>

    Thank you and would really appreciate you help.


    Eymard Guest

  2. Similar Questions and Discussions

    1. display the text vertical
      Hi I am using an xml file to display text in a flash file. It works fine when it?s horizontal but I need to display the text vertical, the screens...
    2. Formatting of vertical Line chart
      Hi, Does anyone know why the last element on a LineChar,t when the form is vertical, does not get displayed correctly? It seems to get partially...
    3. How do you change the vertical grid line color of the header in a datagrid???
      Hi, I managed to change the vertical grid line color for all the rows, but can't get it to work for the header as well. Any help? Thanks
    4. drop down list always a vertical display
      Okay. I followed the steps from a MS KB article (306227, i think) about how to create a frop down box in a data grid, and bind to data. However,...
    5. Vertical line seperating columns? - InDesign CS
      Hi, Is it possible to seperate two columns with a vertical line? I could place the line on my master page, I know, but I don't want it to start...
  3. #2

    Default Re: Display vertical line or pipe if not equal torecordcount

    Hello??? any MM tech support assigned to this thread? :(.
    Eymard Guest

  4. #3

    Default Re: Display vertical line or pipe if not equal torecordcount

    Hi Eymard,

    In response to your second post, no. If you read the disclaimer at the bottom
    of this page,

    Important Note: These online forums are for user-to-user discussions of
    Macromedia products, and are not an official customer support channel for
    Macromedia.

    you should deduce that no one from Adobe/MM will be "assigned" to any thread
    here.

    In response to your original post, Your code creates city + pipe symbol for
    every record in the output. Try changing the evaluation

    cfif ridCount NEQ getC.RecordCount

    to

    cfif ridCount LT getC.RecordCount

    This should eliminate the last pipe symbol.

    HTH,

    philh Guest

  5. #4

    Default Re: Display vertical line or pipe if not equal torecordcount

    Thank you, now I realised that we should always read those long disclaimer statements. :)


    Eymard 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