Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
SQL Trim |
Wed, Aug 12 2009 11:22 PM | Permanent Link |
"John Postnikoff" | Hello,
I would like to trim (remove) the leading two characters in a field for all records of a table. e.g. for example AB1 to 1. There could be over thirty different combinations or unknown suffixes to AB , which could be characters or numbers. e.g. ABTest. AB123. so a simple UPDATE will not suffice. I could not seem get TRIM to work. To further clarify the table name is ORDERS the field is called REF. I have done it with Delphi strings but not with records of a database, or SQL. Any help is appreciated. John P. |
Thu, Aug 13 2009 2:47 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | John
Untested UPDATE orders SET REF = SUBSTR(REF,3,999) WHERE REF LIKE 'AB%' you can set it up as a script or a a paramterised query or something like UPDATE orders SET REF = SUBSTR(REF,3,999) WHERE REF LIKE 'AB%' OR REF LIKE 'GB%' etc Roy Lambert [Team Elevate] |
Thu, Aug 13 2009 9:01 AM | Permanent Link |
"Robert" | "John Postnikoff" <john@trackinfosystems.net> wrote in message news:03DAE8F6-1CD2-4F76-8233-8D8BF41F33BC@news.elevatesoft.com... > Hello, > > I would like to trim (remove) the leading two characters in a field for > all > records of a table. e.g. for example AB1 to 1. There could be over thirty > different combinations or unknown suffixes to AB , which could be > characters > or numbers. e.g. ABTest. AB123. so a simple UPDATE will not suffice. I > could not seem get TRIM to work. > > To further clarify the table name is ORDERS the field is called REF. I > have > done it with Delphi strings but not with records of a database, or SQL. > Any > help is appreciated. > UPDATE ORDERS SET REF = SUBSTRING(REF from 3) Robert |
This web page was last updated on Wednesday, June 12, 2024 at 01:54 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |