Solved

remove last comma

Posted on 2014-12-08
4
99 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
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 …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

815 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now