Print Page | Close Window

Zeros to the left of number (resolved)

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6154
Printed Date: 13 May 2024 at 2:37am


Topic: Zeros to the left of number (resolved)
Posted By: Zamparo
Subject: Zeros to the left of number (resolved)
Date Posted: 22 Apr 2009 at 6:45am
Hi!

I have a int field in the database and when to open the report,  I like to complete with zeros to the left (maximum 6 numbers).

Example:  number 1 ->  000001
               number 20 ->  000020

which formula to use?

Thanks.



Replies:
Posted By: DBlank
Date Posted: 22 Apr 2009 at 7:15am
right(("000000" + totext( mailto:%7b@%7d,0,%29%29,6 - {table.numberfield},0,"")),6 )
 
Note that this is now a text field and no longer numeric.


Posted By: Zamparo
Date Posted: 22 Apr 2009 at 8:04am
Originally posted by DBlank

right(("000000" + totext( mailto:%7b@%7d,0,%29%29,6 - )
 
Note that this is now a text field and no longer numeric.


Excellent!!
Thank you very much!



Print Page | Close Window