5 Replies Latest reply on Jul 19, 2006 5:25 AM by kabbi~thkek

    characters left and right from a value

      From a query I get a value returned. From this value I have to extract certain data. The nr of characters in the value is not alway the same, but I don't need the last 20 characters and the first 3 characters. So Actually I want the values leftover after deleting the last 20 characters and the first 3 characters. Is this possible?
      Does someone knows how?

      This is what I use now:

      Because I know most values returned have 30 characters, I know that the value I need most of the time (but as I said, Not ALL) consist out of 7 characters.

      Here is how I did the extraction to get the right data when the value I need is seven characters:

      <cfquery name ="qtest" Datasource = "">.

      <cfset pnr = left(qtest.wMNAMEUser, 10)>
      <cfset pnr = right(pnr, 7)>

      This works fine for 90 percent of the values I need, because they exist out of 7 valyues. But What I actually would like to do is extract the last 20 characters from the queryvalue and the first three characters from the given queryvalue, and then put the leftover characters into a value.

      Can this be done? Is there someone who could help me?

      Thank you in advance.