Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Count with always 8 characters Post Reply Post New Topic
Author Message
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Topic: Count with always 8 characters
     Posted: 16 Feb 2012 at 11:11pm
Hi all,

I am working in CR to create an overview for a bank. I want to export the file into a text file.
In the footer I want a count and a sum of all the different payments. These fields needs to be 6 and 10 characters long. I used to next formula's:

Count:
Right('000000' & count({RELACIONADO.IDI}),6)

Sum:
Right('0000000000' & sum({DEUDA.CAPITAL}),10)

But when I do this, for the count, I got for example 100.00 where I would like him to give me 000100.

What do I need to change in my formula to get the results in the right way? Can anybody help me?

Thank you all in advance

Kind regards,

Gerben
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 16 Feb 2012 at 11:39pm
Count:

Right('000000' & totext(count({RELACIONADO.IDI}),0),6)


Sum:

Right('0000000000' & totext(sum({DEUDA.CAPITAL}),0),10)


Regards,
Ryan.


Edited by rkrowland - 16 Feb 2012 at 11:39pm
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 17 Feb 2012 at 12:10am
Almost there. It is now giving me 14,026, where I would like him to show it like 014026. Is it something in the formula, of do I need to change some settings somewhere?
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 17 Feb 2012 at 2:00am
Originally posted by Gurbs

Almost there. It is now giving me 14,026, where I would like him to show it like 014026. Is it something in the formula, of do I need to change some settings somewhere?
 
Apologies, try the following;
 
Count:
Right('000000' & totext(count({RELACIONADO.IDI}),0,""),6)


Sum:
Right('0000000000' & totext(sum({DEUDA.CAPITAL}),0,""),10)
 
Regards,
Ryan
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 17 Feb 2012 at 2:13am
Works perfect now, thank you very much!
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