on 10-14-2008 8:25 PM
I have a field that displays in sql as
2.9999999999999
when i place the field in the report it displays as 3.00
i would like to display the actual number. i have tried the following ;
formatting the field every which way
round (field,0)
(if (remainder( 1) > 0 and remainder( 1) < 1) then
truncate( ) + 1 else )
any suggestions would be appreciated
Hi..
Go in Format Field and select Number tab and select the required decimal places and apply.
Thanks,
Sastry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since the Crystal reports depends on system regional settings go to control panel>regional settings>change the no.of decimals for number or currency depending on the data type of the field and give decimal places as 14 and in the report use system default format by right clicking on the field.
I think it works!
Raghavendra
That is what is strange
I have a formula in my detail section which is A\B (A is my nett weight and B my total cases, this formula shows the average wieght per case) which will give a decimal figure and this displays correct. I can't enter a summary of this field so I create a manual formula which is sum(A)\sum(B) the value then in the summary rounds to the closest 1, this for a sepcific group. I have a second group with the exact same formula sum(A)\sum(B) in a another group footer and it does not do it and it is displayed correctly. It does not matter what I do do in the one group it rounds it and in antoher it does not, it happens in Crystal 11 as well, if it is group specific I have no idea why, anyhting else you think I can try ?.
Hi Sharon,
I saw a problem like this a while back with my previous company. I don't remember what the values involved were, and I believe that it was actually a decimal number like 2.0199999 showing up as 2.02, or something to that effect, but it sounds similar.
I agonized over this thing, and as it turned out, the actual stored value of the field was in fact what Crystal was displaying to me. The value that I was getting out of the SQL query analyzer was actually subject to a rounding error.
Long shot, I know.
It could be a function of the drivers that you're using to access the database. They may nor recognize a value to that level of precision. Remember, that at the machine level all values are stored as binary, and fractional decimals don't exactly convert.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The maximum decimal places allowed is 10 in format field. So I would say that convert the value to text before getting it on to the report and now use truncate function or left() to get the desired result and then convert in to decimal if you ant to use it in calculations.
You can use add command like this
select convert(varchar(14),field) as fieldname from table
Hope this Helps!
Raghavendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Truncate instead of round?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this
Right click on the field and go to format field and select the number format you want like 123.00 and click on customize and choose decimals from the drop down and click on OK
Regards,
Raghavendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.