Trim First n characters of a string using in db formula
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Pssw0rd
5 - Atom
‎06-08-2023
04:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Team,
I am unable to get an output where I want to get all the characters post "-" from a string field using the in db formula tool.
Input: 00165 - Basic Service fees
Output: Basic Service fees
Any help would be appreciated,
Thanks,
Labels:
1 REPLY 1
17 - Castor
‎06-08-2023
05:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @Pssw0rd, what database are you using? The In-DB tools require you to use the correct SQL syntax for the platform you're connecting to. Here's a couple of some methods that would work using, a - Oracle:
SELECT
SUBSTR(<FieldName>,INSTR(<FieldName>,'- ')+2)
FROM <TableName>
b - Snowflake:
SELECT
REGEXP_SUBSTR(<FieldName>,' - (.*)',1,1,'e')
FROM <TableName>
Hope this helps!
