Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Crystal Reports - Trim Data

Posted on 2016-09-15
7
Medium Priority
?
110 Views
Last Modified: 2016-09-15
Hello,

I’m wanting to trim a field.

I have a product code like the following:
100003.BLK.SML
104+YEL+LRG
1005-GRE-XLG

I need to trim the code so it appears like below taking into account the following characters . + / * -

100003
104
1005

The code length can’t exceed 16 characters.

Thank you
0
Comment
Question by:jspc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 41800867
what's your backend database? are you able to manipulate the data from backend source instead?
0
 

Author Comment

by:jspc
ID: 41800869
SQL Database
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 41800871
DO you just need the leading numeric part?
If so use

Val({YourField})

Open in new window


If you want it as a string use

CStr(Val({YourField}),0)

Open in new window


mlmcc
0
New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

 

Author Comment

by:jspc
ID: 41800874
yes just front front part as per my example
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 41800877
Will the front part always be numeric?
If so, My formula should work.


If it can include non-numeric data then try

SPlit(Replace(Replace({YourField},'+','.'),'-','.'),'.')[1]

Open in new window


mlmcc
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 41800878
My String formula will result in a comma

use
1:CStr(Val({YourField}),0,'')

Open in new window

0
 

Author Closing Comment

by:jspc
ID: 41800882
Bingo! Thanks
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question