473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Issue with fixed decimal places

2
Hello
I have an update qry to a table with a field defined as Number/Double/Fixed/3 decimal places.
When I view table the field displays as .001, but when I click on the field it displays as.00057. I need to use this field in later calculations to be .001, but in the later calculations it is using .00057.
How can I keep this field at .001?

Thank you
Apr 30 '20 #1
3 1968
NeoPa
32,556 Expert Mod 16PB
Hi there.

Don't confuse how data is displayed with how data is stored. It's a common misconception that trips up many people.

Really you need to ensure that the original UPDATE query is fixed to do what you need but we don't have that available at this time so I'll try to put something together that illustrates the point & the technique and shows how the existing data can be fixed. Post your original query if you'd like us to illustrate what you need more directly. Better still, post that with a fixed version that you think is the solution and we'll confirm or deny & help further if necessary.
Expand|Select|Wrap|Line Numbers
  1. UPDATE [YourTable]
  2. SET    [YourField]=Round([YourField],3)
Apr 30 '20 #2
memfbi
2
Hello
Thought I had this working, but not quite. It appears that I need to round up to get the correct answer.... I need the below to return .113, but is returning .112
MGCP10 = 5.00 VOLP00 = 225
Expand|Select|Wrap|Line Numbers
  1. UPDATE PGAS000
  2.        LEFT JOIN
  3.        PGASC02
  4.     ON PGAS000.MGC100 = PGASC02.GPRD02
  5. SET    PGAS000.[MGC1$0] = ((Round([MGCP10]/100*[VOLP00]/100,3)))
May 4 '20 #3
NeoPa
32,556 Expert Mod 16PB
You have hit the Banker's Rounding problem (See Allen Browne's page on rounding - which incidentally is ok to link to as MS MVPs are valid for the relevant MS software).

There's a link on that page to a function you can add to your project if you want Arithmetic Rounding. There may be alternative solutions by now as this page goes back to when Access 2000 was current ;-)
May 5 '20 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

36
by: Andrew | last post by:
I trying to format my output to display a set number of decimal places. I have been trying to use the <iomanip> setprecision(), but that will only display the total number of digits. Can someone...
2
by: David Nunn | last post by:
Need to preface that I am not much of an Access type. Doing I have several tables that have currency fields, which I run queries against to compare the figures in both. The data is imported from...
3
by: N J | last post by:
Hi, I am trying to calculate tax on my form, but the value in the unbound text box is x.xxx , how do I get this to just x.xx ? TIA -- Kind Regards,
3
by: paulquinlan100 | last post by:
Hi I have a couple of calculated fields in a report, i've set the Decimal Places property to 0 and the format to General Number, however when previewing the report it still comes up with a...
19
by: VK | last post by:
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/ b495b4898808fde0> is more than one month old - this may pose problem for posting over some news servers. This is why I'm...
10
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I convert a Number into a String with exactly 2 decimal places?...
4
by: Todd | last post by:
I have a function that takes a double and truncates it to a specified number of decimal places. I've found that I have to add a small number to the input value otherwise I get errors due to the...
4
by: ChipR | last post by:
I have a table with currency fields set to 2 decimal places. My query has Percent: IIf(=0 Or IsNull(),0,/*100) Even with a balance and estimate with 1 digit decimals I'm getting 13 digits...
5
by: scottrmeredith | last post by:
I have a restaurant I am creating a DB for, and the POS system and all other revenue sources display a sales total on the reporting with tax included. I am trying to create a formula in a query,...
1
by: profburns | last post by:
I have a database with 8 calculated fields. In each calculated field, I would like to have some values with 0 decimal places, while others would have 1 place, based on the values in the records that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.