Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: String with blanks Post Reply Post New Topic
Author Message
sanchezgmc06
Senior Member
Senior Member
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Quote sanchezgmc06 Replybullet Topic: String with blanks
    Posted: 24 Feb 2021 at 5:15pm
Hi

Im writing a report in SQL where I need to bring back a customer name in 20 characters.
However customer names vary and for those names with less than 20 characters I need to bring back spaces to complete the 20 characters.

Any ideas?

Thank you in advance
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Feb 2021 at 3:55am
you mean you always want 20 characters with spaces to pad out the remainder?
in a formula field, concatenate the field and a string with 20 spaces and then grab the left 20 of that...
left([table.namefield]+'                    ',20)
IP IP Logged
sanchezgmc06
Senior Member
Senior Member
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Quote sanchezgmc06 Replybullet Posted: 30 Apr 2021 at 10:55am
Thank you !! it worked
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.031 seconds.