Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Leading Zeros Post Reply Post New Topic
Author Message
ifejza
Newbie
Newbie
Avatar

Joined: 22 Apr 2009
Location: Albania
Online Status: Offline
Posts: 11
Quote ifejza Replybullet Topic: Leading Zeros
     Posted: 02 Aug 2009 at 3:26am
How to eliminate leading zeros in crystal reports?

I have a field with 20 characters and only 5 last field are digit number different from zero.

How to convert 00000000000003456 --> 3456

Thanks and advance
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Aug 2009 at 5:02pm

create a formula field and convert it to a number field...

tonumber({table.textfield})
 
You can then right click on that field and format it as needed (e.g. no decimals)


Edited by DBlank - 02 Aug 2009 at 5:03pm
IP IP Logged
ifejza
Newbie
Newbie
Avatar

Joined: 22 Apr 2009
Location: Albania
Online Status: Offline
Posts: 11
Quote ifejza Replybullet Posted: 08 Aug 2009 at 4:41am
Thanks DBlank,

But I don't explain in right way.

How to convert 00000000000003456AB --> 3456AB

I find one solution, but maybe exist better solution.

substring(column_name, patindex('%[^0]%',column_name), 10)

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