Description: I have two fields "county_population" and "state_population" each formatted as double[DOUBLE]. The third field is a calculated field "county_population" / "state_population". When I run query, the results show only two decimal places; I would like it to show six decimal places. I've tried using CAST as DECIMAL and I've tried multiplying "county_population" *1.000000 to no avail. Steps to Reproduce: 1. create two fields "state_population" "county_population" both formatted as double[DOUBLE] 2. create a calculated field density "county_population"/"state_population" 3. run query Actual Results: state_population county_population density 4908621 55869 0.01 4908621 223234 0.05 4908621 44428 0.01 7378494 38837 0.01 2910357 8525 0 Expected Results: state_population county_population density 4908621 55869 0.011382 4908621 223234 0.045478 4908621 44428 0.009051 7378494 38837 0.005264 2910357 8525 0.002929 Reproducible: Always User Profile Reset: Yes OpenGL enabled: Yes Additional Info: none
Did you change the format of the column? It will only show 2 decimal places by default, but when I change it to four decimal places it will show the expected result here.
Note: Formatting of a query isn't saved anywhere. So you will loose the formatting after closing and reopening the query. You will get the formatting saved in views, in forms or in reports.
Formatting the query column works, but I shouldn't have to format the columns each time I run a query. Also, when I save the query, it reverts back to two decimals and the report is based off the saved query. I really think this needs to be fixed.
(In reply to fox2 from comment #3) > Formatting the query column works, but I shouldn't have to format the > columns each time I run a query. Also, when I save the query, it reverts > back to two decimals and the report is based off the saved query. I really > think this needs to be fixed. You need this query for a report? The report will save the formatting of a field. There is nothing lost. Only the query doesn't show this by default. One hint together with reports: I don't use queries for a report, because it works only with simple queries. I prefer to create view for a report. I will set this one to NEW and ENHANCEMENT, because it has never been possible to save the formatting of a query. Also switched the version to "Inherited From OOo"
(In reply to Robert Großkopf from comment #4) > (In reply to fox2 from comment #3) > > Formatting the query column works, but I shouldn't have to format the > > columns each time I run a query. Also, when I save the query, it reverts > > back to two decimals and the report is based off the saved query. I really > > think this needs to be fixed. > > You need this query for a report? The report will save the formatting of a > field. There is nothing lost. Only the query doesn't show this by default. I don't necessarily need it for a report; nonetheless, I am unable to save the format. steps: right click on column > column format > decimal places=6 > ok > file > save > close > double click query...back to two decimal places. I can reformat column again, but am unable to save it, so I can't get the report to show six decimal places. > > One hint together with reports: I don't use queries for a report, because it > works only with simple queries. I prefer to create view for a report. I will try working with query/view > > I will set this one to NEW and ENHANCEMENT, because it has never been > possible to save the formatting of a query. Also switched the version to > "Inherited From OOo" Thank you