Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Changing 1 to 01 Post Reply Post New Topic
Author Message
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Topic: Changing 1 to 01
     Posted: 28 Jul 2010 at 9:34am
I'm using a 'Record Number' field and am looking for a way to change number 1-9 to have a zero in front of it.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 28 Jul 2010 at 10:37am
If you will only have numbers up to 99, try somthing like this:
 
right('00' + ToText({table.record_number}, 0), 2)
 
If you can have more than 99, you'll need to extend the number of zeros and the number of characters you want.
 
-Dell
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 29 Jul 2010 at 3:08am
Thanks for your suggestion. However, I wasn't descriptive enough with my posting. The 'Record Number' field on the report is from the 'Special Fields' tab of the 'Field Explorer', which isn't a table record.
 
This field doesn't show up in the 'Report Fields' of the Formula Workshop.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 29 Jul 2010 at 3:28am
Try this:
 
right('00' + ToText(recordnumber, 0), 2)
 
-Dell
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 29 Jul 2010 at 3:36am
That was an easy fix. I did try it the way you just suggested initially, but for some reason, it wasn't working. When I copied and pasted your formula, it worked great.
 
Thanks for your help.
IP IP Logged
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