[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Ltrim/Rtrim usage



The way ltrim and rtrim work, you are removing any occurances of "T", "A",
or "X" at the beginning or the end of the string.  To remove "TAX" at the
beginning, you may have to say:

if substr($document, 1, 3) = 'TAX'
  let $document1 = substr($document, 4, length($document) - 3)
end-if

To remove it at the end, say:

if substr($document1, length($document1) - 2, 3) = 'TAX'
  let $document1 = substr($document1, 1, length($document1) - 3)
end-if

-----Original Message-----
From: sqr-users-bounces+steven.alexander=sanjoseca.gov@sqrug.org
[mailto:sqr-users-bounces+steven.alexander=sanjoseca.gov@sqrug.org]On
Behalf Of Kaz.Narayanan@averydennison.com
Sent: Tuesday, November 30, 2004 10:29 AM
To: This list is for discussion about the SQR database reporting
language from Hyperion Solutions.
Subject: [sqr-users] Ltrim/Rtrim usage



Hi,

I am trying to trim a value 'TAX' in an SQR.
My codes are as follows:


      let $document1 = ltrim($document , 'TAX')
      let $document1 = Rtrim($document1 , 'TAX')
      let $document1 = ltrim($document1 , ' ')
      let $document1 = rtrim($document1 , ' ')


For Example if I have a value of '8710212004ATAX' in $document I want
$document1 to be '8710212004A' without the 'TAX'
however, the $document1 is also trimming the 'A' before the 'TAX'. I want
the
$document1 to be '8710212004A'

Am I doing anything wrong? Any Suggestions?

Thanks
Regards
KM Narayanan



-----------------------------------------
The information transmitted is intended only for the person or entity  to
which it is addressed and may contain confidential and/or  privileged
material. Any review, retransmission, dissemination or  other use of, or
taking of any action in reliance upon, this  information by persons or
entities other than the intended recipient  is prohibited. If you received
this in error, please contact the  sender and delete the material from any
computer.


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users