Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace or concatenate? 1

Status
Not open for further replies.

mochalova

MIS
Sep 20, 2007
15
US
Hello Folks,

does anyone know how I can change this

SOH01123,SOH01146,SOH01141,SOH01185

to

SOH01123','SOH01146','SOH01141','SOH01185

Thanks
 
Try:
Code:
<cfset myList=ListChangeDelims(MyList,"','",',')>

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
mochalova,

I am not sure what you are doing with the results. But if you are using the values in a SQL statement, consider using cfqueryparam with the "list" attribute instead. Then no quotes are needed.

(Untested)
Code:
<cfquery...>
SELECT Columns, .... 
FROM   SomeTable
WHERE  SomeColumn IN 
(
     <cfqueryparam 
         value="SOH01123,SOH01146,SOH01141,SOH01185"
         cfsqltype="cf_sql_varchar"
         list="true" >
)
</cfquery>

----------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top