Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: truncate a number Post Reply Post New Topic
Page  of 2 Next >>
Author Message
fabiola
Newbie
Newbie


Joined: 03 Nov 2010
Online Status: Offline
Posts: 9
Quote fabiola Replybullet Topic: truncate a number
    Posted: 26 Jan 2011 at 2:19am

Hi All

i'm a newbie to Crystal Reports. Hope someone can help me out.
 
I have a 19 digit number on a report and would like to see only the last 6 digits? How is this done?
If you show step by step
TIA
Fabiola 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2011 at 3:40am
right(totext(numberfield,0,""),6)

Edited by DBlank - 26 Jan 2011 at 3:40am
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 26 Jan 2011 at 4:09am
hi DBlank,

it is showing in exponential format.
e.g.: 1234567890123456789 --> 1e+019

it should shown as 456789.

we need to work around for it.

Emir W
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2011 at 4:21am
not sure i understand. The data as it is brought into crystal is appearing as the expontial version or it is appearing a numeric field with a length of 19?
IP IP Logged
fabiola
Newbie
Newbie


Joined: 03 Nov 2010
Online Status: Offline
Posts: 9
Quote fabiola Replybullet Posted: 26 Jan 2011 at 4:57am

 it is appearing a numeric field with a length of 19

Here is an example
9874563214569874563
I would like to see
874563


Edited by fabiola - 26 Jan 2011 at 5:05am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2011 at 5:16am
did you try the formula I gave you on my first post?
right(totext({table.numberfield},0,""),6)
IP IP Logged
fabiola
Newbie
Newbie


Joined: 03 Nov 2010
Online Status: Offline
Posts: 9
Quote fabiola Replybullet Posted: 26 Jan 2011 at 5:22am
I did ...and get a message back saying to many arguments have been given to this function
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2011 at 5:25am
what do you get with
totext({table.numberfield},0,"")
IP IP Logged
fabiola
Newbie
Newbie


Joined: 03 Nov 2010
Online Status: Offline
Posts: 9
Quote fabiola Replybullet Posted: 26 Jan 2011 at 5:35am
this is what i entered

totext({vw_FactCardTransHist.CardNo},0,"")
 
i got back too many arguments have been given to this function
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2011 at 5:47am

I think this isaleady a string field that is displaying numbers.

try
right({vw_FactCardTransHist.CardNo},6)
IP IP Logged
Page  of 2 Next >>
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.