Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crystal Reports - Trim Data

Posted on 2016-09-15
7
Medium Priority
?
117 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
  • 3
  • 3
7 Comments
 
LVL 54

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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Integration Management Part 2
Suggested Courses

927 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