Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Removing decimals on a QTY string Post Reply Post New Topic
Author Message
Frostmorne
Newbie
Newbie
Avatar

Joined: 10 Jan 2011
Location: South Africa
Online Status: Offline
Posts: 4
Quote Frostmorne Replybullet Topic: Removing decimals on a QTY string
     Posted: 10 Jan 2011 at 3:04am
Hi people, i'm editting a report in Crystal 11 for a client. The database field is @sQTY(string) and it populates the collum with quantity figgures. I want to remove the current decimal places from 7.2000 to 7.2.

If i rightclick on it and go to "format field...", i do not get the "numbers" tab to change the decimal places. Formula currently looks like this:

ToText({OEORDD.QTYORDERED},ToNumber({?QTYDEC}))

Its a SQL database, using Accpac ERP.The first section is the Database table and the Field and i presume the second on is the crystal one. Do i need to change this formula and any ideas what is should be?

Thanks
RTFM!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jan 2011 at 4:10am

not exactly sure what you are trying to do with your formula. It appears that you are letting the iser select the number of decimal spaces to display on the qtyordered field.

If you just want it to show 1
totext(qtyordered,1)
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 10 Jan 2011 at 6:10am
The 2nd argument is the number of decimals.

Maybe instead of using a formula for the field you can just drag {OEORDD.QTYORDERED} into the report and then format field?

Since the formula returns a string, it would make sense that you are not getting a Number tab.

But I am curious whaT QTYDEC is about. Is it the number of decimals for the particular value and that it was decided it is no longer necessary?

Edited by Keikoku - 10 Jan 2011 at 6:34am
IP IP Logged
Frostmorne
Newbie
Newbie
Avatar

Joined: 10 Jan 2011
Location: South Africa
Online Status: Offline
Posts: 4
Quote Frostmorne Replybullet Posted: 10 Jan 2011 at 11:42pm
Cool thanks man, i did what you suggested by inserting the table and field in directly. Not to sure why it was a formula anyway because its just displaying the unit weight.

Thanks for the help!
RTFM!
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