Author |
Message |
fabiola
Newbie
Joined: 03 Nov 2010
Online Status: Offline
Posts: 9
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 26 Jan 2011 at 3:40am |
right(totext(numberfield,0,""),6)
Edited by DBlank - 26 Jan 2011 at 3:40am
|
IP Logged |
|
Emir_W
Senior Member
Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
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 Logged |
|
fabiola
Newbie
Joined: 03 Nov 2010
Online Status: Offline
Posts: 9
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
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 Logged |
|
fabiola
Newbie
Joined: 03 Nov 2010
Online Status: Offline
Posts: 9
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 26 Jan 2011 at 5:25am |
what do you get with
totext({table.numberfield},0,"")
|
IP Logged |
|
fabiola
Newbie
Joined: 03 Nov 2010
Online Status: Offline
Posts: 9
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
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 Logged |
|
|