All,

With help from the MM CF Forums I got the answer. For testing I was
typing a literal string, not working with values direct from the DB.
Somehow that caused the problem. Here's the code that works (Remember
I'm trying to split this value into two new ones)

<cfquery name="test" datasource="GTS_Dental">
        SELECT "1" <!--- this is the name of the field after the Excel
SS is imported into Access
        AS Products
        FROM Acrylics_Custom_Tray_Materials
        WHERE ID=25
</cfquery>
<cfset Variables.products = test.Products>
<cfset Variables.ProdNameCount = Find("##",Variables.Products) -1> 
<cfset Variables.ProdNumCount = Len(Variables.Products) -
Variables.ProdNameCount> 
<cfset Variables.NewProd =
Trim(Left(Variables.products,Variables.ProdNameCount))>
<cfset Variables.NewProdNum =
Trim(Right(Variables.products,(Variables.ProdNumCount -1)))>

My new question is this. Occasionally the "Products" value will have a #
that I need to keep, so I'll need to split on the last # in the string.
Looking through the CF String Manipulation functions, I don't see
anything that will return a count of a particular character. I haven't
found any on cflib.org as well.

How could I find how many of a certain characters are in a string?

Thanks,

James

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to