Solved

remove last comma

Posted on 2014-12-08
4
104 Views
Last Modified: 2014-12-08
Hi,

How can I remove my last comma?

          <cfquery name="New_Portal" datasource="#dsn#" username="#dbID#" password="#dbPassword#">
								Select PortalId as PID, PortalName as PN
								From AppPortal
								Where PortalID IN (#New_Data.Portal#)
							</cfquery>   
                            <CFIF (isDefined("New_Portal") and #New_Portal.RecordCount# gt 0)>
                            <cfoutput query="New_Portal">
                            #New_Portal.PN#,
                            </cfoutput>
                            </CFIF>

The output is this: 

Agent, Group, Internal Facing, Member, Provider, N/A, 

The output that I want is this: 

Agent, Group, Internal Facing, Member, Provider, N/A

Open in new window

0
Comment
Question by:lulu50
  • 2
  • 2
4 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 40486679
Option One...
<cfset allPN = valueList(New_Portal.PN)>
  #allPN#

Option Two..

       <CFIF (isDefined("New_Portal") and #New_Portal.RecordCount# gt 0)>
               <cfoutput query="New_Portal">
                   <cfif new_portal.currentRow gt 1>,</cfif> #New_Portal.PN#
              </cfoutput>
     </CFIF>
0
 

Author Comment

by:lulu50
ID: 40486746
gdemaria,

IIIITTTTT IIIIISSSS WORKING!!!!

GREATTTTTTT!!!!

Thank you :-)
0
 

Author Closing Comment

by:lulu50
ID: 40486747
Thank you
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 40486786
super!  Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question