Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
Performance Management
Lawson Business Intelligence/Reporting/Crystal
Query to split string into two parts
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
AshDilly5
Past 24 Hours:
1
Prev. 24 Hours:
1
Overall:
5326
People Online:
Visitors:
360
Members:
0
Total:
360
Online Now:
New Topics
Lawson Add-Ins for Microsoft Office
Lawson Add-in
9/30/2025 6:51 PM
I am looking for a Lawson Add-ins query to add new
Lawson S3 Procurement
Anyone getting PO 0000 not found for company error in PO23?
9/30/2025 2:45 AM
Anyone getting PO 0000 not found for company error
Lawson Add-Ins for Microsoft Office
PO20 - Cancel PO via Add-in
9/25/2025 8:03 PM
Is it possible to cancel PO's using add-ins? I
S3 Systems Administration
S3 Payroll - PayStubs
9/18/2025 6:58 PM
Looking for a reliable solution to streamline the
S3 Systems Administration
Quick Access report
8/25/2025 7:17 PM
Looking for a good way to see who has access Lawso
S3 Customization/Development
LP01 hiding a PTO plan from the list
8/13/2025 4:44 PM
Hi all. is there a way to hide a specific PTO&n
Lawson Business Intelligence/Reporting/Crystal
GLTrans - PO Line/MAInvdtl
8/6/2025 6:13 PM
Hello, we have an existing tabular model for fina
IPA/ProcessFlow
Retrieving GUID from InforOS
7/25/2025 2:22 AM
Hello everyone, I was wondering if there is a way
IPA/ProcessFlow
IPA for forwarding cost messages (MA64/MA66.3)
7/23/2025 6:07 PM
When a buyer has an invoice cost message where the
Lawson Portal
Lawson ESS customization
6/23/2025 10:28 AM
I want to add new links and customize the ESS (sel
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3293
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1377
Roger French
1315
mark.cook
1244
Forums
Filtered Topics
Unanswered
Unresolved
Announcements
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
Performance Management
Lawson Business Intelligence/Reporting/Crystal
Query to split string into two parts
Please
login
to post a reply.
4 Replies
0
Subscribed to this topic
22 Subscribed to this forum
Sort:
Oldest First
Most Recent First
Author
Messages
DavidBrianCampbell
New Member
Posts: 0
9/19/2007 4:44 PM
I am trying to split a number into two parts and wondering if anyone has a suggested syntax? (e.g. 107511 split into 107 and 511 and then alias each with the "AS" keyword.) Thanks!
Chris Martin posted this when I was trying two join 3 fields into one (I'm kinda doing the reverse now):
trim(last_name) || ', ' || trim(first_name) || ' ' || case when trim(middle_init) is null then trim(middle_init) else trim(middle_init) || '.' end
DavidBrianCampbell
New Member
Posts: 0
9/19/2007 5:16 PM
Split
To be more specific, the field that I'm trying to split is EMPLOYEE.DEPARTMENT (String [5])
So for example I want this value: "10050" split into "100" and "50" and
SELECT EMPLOYEE.EMPLOYEE, EMPLOYEE.DEPARTMENT, rtrim(DEPARTMENT-' ') AS LAST2 ltrim(DEPARTMENT-' ') AS FIRST3 FROM EMPLOYEE
Thanks!
Chris Martin
Veteran Member
Posts: 277
9/19/2007 5:25 PM
Split
Use the substr function:
a) substr(department,1,3) as FIRST3
b) substr(department,4,2) as LAST2
The LAST2 will only give you what you want if all of your departments 5 characters long.
k-rock
Veteran Member
Posts: 142
9/20/2007 11:42 AM
Split
I'm not a Crystal user, but there has to be some function like LEN in excel.
substr(department, 1, 3) as FIRST3
substr(department, 4, LEN(department)-3) as LAST
that should give you the remainder of the string
John Henley
Posts: 3362
9/20/2007 2:39 PM
Split
Brian, are you trying to do this within the SQL command itself (i.e. you're not reporting against tables but against a SQL command [or a SQL Expression in Crystal, which uses the vendor-specific SQL syntax] (and if so, what flavor: Oracle, MSSQL, etc.?), or via a Crystal Formula? The reason I ask is because the syntax is different.
Please
login
to post a reply.