How to extract a Substring from a String in Sage X3

By | April 12, 2018

While dealing with strings, we often require certain characters or a substring from given string. Sage X3 provides a special function to extract a substring from provided CLOB or a string.

Syntax: 

mid$(EXP_STRING,EXP_POS,EXP_NB)

Where, 

  • EXP_STRING is an expression returning a CLOB or string value.
  • EXP_POS is an expression returning an integer value that is the position of the first character to be extracted.
  • EXP_NB is an expression returning an integer value that defines the number of characters to be extracted. 

Example:

In below example, 3 characters from 4th position of a string “Welcome!” are extracted.

substring from string

Output: 

It gives substring “com” as an output.

extract substring from string

Hope this helps!

About Us

Greytrix is a one stop solution provider for Sage ERP and Sage CRM needs. We provide complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third party add-on development and implementation expertise.

Greytrix has some unique solutions of Sage X3 integration with Sage CRMSalesforce.com and Magento eCommerce along with Sage X3 migration from Sage 50 US, Sage Pro and QuickBooks.  We also offer best-in-class Sage X3 customization and development services to Sage business partners, end users and Sage PSG worldwide.

For more information on Sage X3 Integration and Services, please contact us at x3@greytrix.com. We will be glad to assist you.