Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fixed Length Fields 1

Status
Not open for further replies.

ewilkes

IS-IT--Management
Feb 10, 2003
8
US
I have a crystal report that I need to export in a fixed-length ascii format. I need to make the field length, for example, 30 characters regardless of the data in it. How can I do this? I've used "left" to limit the field to 30 char's but that only helps if the length of the text exceeds 30 char's. How can I make it 30 even if the text is, say, 10 char's. Thank you
 
I am assuming you want to put a space for the rest of the characters. If so the following formula should work:

If Length({YourString})>= 30 then left({YourString},30) else trim({YourString})&Replicatestring(" ",30-length(trim({YourString})))



Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top