Ask a Question related to Coldfusion Database Access, Design and Development.
-
Eymard #1
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> <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> |</cfif></cfoutput></li>
</ul>
</div>
<br clear="left" />
</cfoutput>
Thank you and would really appreciate you help.
Eymard Guest
-
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... -
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... -
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 -
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,... -
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... -
Eymard #2
Re: Display vertical line or pipe if not equal torecordcount
Hello??? any MM tech support assigned to this thread? :(.
Eymard Guest
-
philh #3
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
-
Eymard #4
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



Reply With Quote

