String with blanks

Printed From: Crystal Reports Book — Forum Name: Technical Questions

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
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)
Thank you !! it worked