Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Crystal TrimLeft Post Reply Post New Topic
Author Message
Liz Williams
Newbie
Newbie
Avatar

Joined: 28 Aug 2009
Location: United States
Online Status: Offline
Posts: 11
Quote Liz Williams Replybullet Topic: Crystal TrimLeft
     Posted: 26 Jul 2010 at 11:28am

Confused I have two parameter fields used to pull in a range of check numbers. The field name is {PLPPV.PVPREF} it’s an 18 char long, right justified string. When I’m prompted for the check numbers range, I have to space 12 times and then key in the last six digits of the check number in order for the report to pull in data otherwise the report is blank.  How do I trim any leading spaces so that I can key in only the six digits and still come back with the results?

PS the check numbers may vary in size and could be less or more the six but the field is always 18 char. long. Using CRXI

 

Thanks for any help.

 

Dazed & Confused

 

Gamblers Go Broke
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jul 2010 at 11:55am
what is your current select statement?
Maybe you could to tonumber function
or
maybe an addition of the strings then a right function
right("                   " + {?param},18)
IP IP Logged
Liz Williams
Newbie
Newbie
Avatar

Joined: 28 Aug 2009
Location: United States
Online Status: Offline
Posts: 11
Quote Liz Williams Replybullet Posted: 26 Jul 2010 at 12:03pm
{PLPPV.PVPREF} in {?FromCheck#} to {?ToCheck#}
Also the check numbers can be a mixture of alpha and numeric if that matters.
 
Gamblers Go Broke
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jul 2010 at 12:12pm
I have never had much consistently proper results when using the IN option with strings (field in string1 to stgring2).
 
That being said you could try this...
 
{PLPPV.PVPREF} in right("                  "+{?FromCheck#},18) to right("                  "+{?ToCheck#},18)
IP IP Logged
Liz Williams
Newbie
Newbie
Avatar

Joined: 28 Aug 2009
Location: United States
Online Status: Offline
Posts: 11
Quote Liz Williams Replybullet Posted: 26 Jul 2010 at 12:26pm

You are now officially my hero!! That worked beautifully.

Thank you so very much for your help and in such a timely manner.

I'm new to all of this and tend to over think things. If you never use the IN what would you use? that just defaulted in when I selected the between from the select expert.
 
Again Thanks for your help. Thumbs%20Up
Gamblers Go Broke
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jul 2010 at 12:29pm
I would try and trim out the alpha portion and use the IN in the numeric but if it is working just leave it alone Thumbs%20Up
IP IP Logged
Liz Williams
Newbie
Newbie
Avatar

Joined: 28 Aug 2009
Location: United States
Online Status: Offline
Posts: 11
Quote Liz Williams Replybullet Posted: 26 Jul 2010 at 12:46pm

Another quick question; what if the check numbers are 7 or 8 char. long will this formula still apply?  I have six companies and some check numbers maybe higher.

Gamblers Go Broke
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jul 2010 at 1:25pm
it will always use the length of the check and then pad on the spaces up to to a totla of 18 charachters so it should be fine as long as it is always looking for 18 characters
IP IP Logged
Liz Williams
Newbie
Newbie
Avatar

Joined: 28 Aug 2009
Location: United States
Online Status: Offline
Posts: 11
Quote Liz Williams Replybullet Posted: 27 Jul 2010 at 4:19am

That's great, you've been a great help.

Thanks
Gamblers Go Broke
IP IP Logged
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