Does Access use Round() to display different levels of precision? (1 Viewer)

Margarita

Registered User.
Local time
Today, 18:30
Joined
Aug 12, 2011
Messages
185
Hello,
I have some currency fields in a table and I set their decimal places to 2 so only 2 are displayed. But some have more digits so that the actual value in the cell can be slightly different than what is displayed. I want to replace the value in the cells so that the ACTUAL value is the one that is displayed while the decimal places property is set to 2 (that is, the value I see right now without clicking into the cell).
So would I replace using

PHP:
set [field1]= round([field1], 2)

or does Access use a different rounding function for displaying numbers up to a certain number of decimal places?
Thank you.
 

ypma

Registered User.
Local time
Today, 23:30
Joined
Apr 13, 2012
Messages
643
I use a query as my data souce and changed the default for currency which is 2 decimal palces to 3 places by the following :

feeslegal: FormatCurrency(Round([legalfees]),3) so i am assuminhg if you replaced my 3 with a 2 it will round to 2 places .Just a thought .

Regards

after note ROUNDING CAN BE UP OR DOWN
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:30
Joined
Aug 30, 2003
Messages
36,133
The Round() function should work for you. Beware that Access uses bankers rounding:

?round(1.5,0)
2
?round(2.5,0)
2
 

John Big Booty

AWF VIP
Local time
Tomorrow, 08:30
Joined
Aug 29, 2005
Messages
8,262
If you simply want to update every record in your table you could use the following;
Code:
Dim strSQL As String

strSQL  = "UPDATE YourTableName SET YourTableName.[YourFieldName] = Round([YourFieldName],2);"

DoCmd.RunSQL strSQL
 

Margarita

Registered User.
Local time
Today, 18:30
Joined
Aug 12, 2011
Messages
185
Hello, the update statement was what I was going to use. I just wanted to first make sure that using round will leave me with the values that the user currently sees displayed- because this is the actual value that we want stored.
You have all reasurred me. I am going to go ahead and update the table.
Thank you!
 

Users who are viewing this thread

Top Bottom