Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Zeros to the left of number (resolved) Post Reply Post New Topic
Author Message
Zamparo
Newbie
Newbie


Joined: 22 Apr 2009
Location: Brazil
Online Status: Offline
Posts: 2
Quote Zamparo Replybullet Topic: Zeros to the left of number (resolved)
    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.


Edited by Zamparo - 22 Apr 2009 at 8:40am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Apr 2009 at 7:15am
right(("000000" + totext({table.numberfield},0,"")),6)
 
Note that this is now a text field and no longer numeric.


Edited by DBlank - 22 Apr 2009 at 7:16am
IP IP Logged
Zamparo
Newbie
Newbie


Joined: 22 Apr 2009
Location: Brazil
Online Status: Offline
Posts: 2
Quote Zamparo Replybullet Posted: 22 Apr 2009 at 8:04am
Originally posted by DBlank

right(("000000" + totext({table.numberfield},0,"")),6)
 
Note that this is now a text field and no longer numeric.


Excellent!!
Thank you very much!
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.