Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Can't link to string because of spaces Post Reply Post New Topic
Author Message
carstowal
Groupie
Groupie


Joined: 31 Jul 2008
Online Status: Offline
Posts: 80
Quote carstowal Replybullet Topic: Can't link to string because of spaces
    Posted: 23 Jun 2015 at 8:16am
I have an excel spreadsheet with a list of part numbers (text) and list of codes (text).

The codes are a 2 digit number for example: 13.

The problem is in the Oracle database (JDEdwards) the Code field is a 24 character string field, stored as 10-spaces followed by the 2-digit code, for example: "          13" with no trailing spaces.

I know I can enter the 10 space prefix in the excel file but I want to make it easy on other users to just load part numbers and codes into the excel file and run their crystal report without making them add blank spaces.

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 23 Jun 2015 at 10:28am
In a formula you could either do a LTrim({FieldName}), or a Right({FieldName},2).  There is another way in which you treat the string as an array.
IP IP Logged
carstowal
Groupie
Groupie


Joined: 31 Jul 2008
Online Status: Offline
Posts: 80
Quote carstowal Replybullet Posted: 23 Jun 2015 at 10:32am
I did write numerous formulas using trim({field name}). That works, I just was looking for a way to link the fields.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Jun 2015 at 3:53am
use a command object to trim the field at the source then join to that trimmed field?

Edited by DBlank - 24 Jun 2015 at 3:53am
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 24 Jun 2015 at 4:56am
I believe there is a LTrim for Oracle.  Thus when joining tables it would be something like this

Inner Join sometable on LTrim(sometable.field) = othertable.field

I am not sure what other string functions are available in Oracle.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.