Solved

Crystal Reports - Trim Data

Posted on 2016-09-15
7
29 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 49

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 100

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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

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

Accepted Solution

by:
mlmcc earned 500 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 100

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now