I am having a problem with my Access 2000 front end to a SQL 7 or 2000
database. I create a table in SQL with a field named, say, amt, data
type MONEY. When I link the table in Access using ODBC, the field is
defined as CURRENCY, as expected. Now, if I use SQL to populate the
field with a 3- or 4-decimal amount like 1.234, it appears in the
Access table as 1.23 only. If I expand the decimals to 3 places it
will be 1.230; if the orginal value was 1.236 it will be rounded to
1.240. It seems like Access or ODBC is rounding the SQL MONEY field to
2 decimal places. Both SQL and Access will support 4 decimal places.
If I look at the SQL data using ADO from Access I get 4 decimal places
returned as expected. Can anyone offer a suggestion before I convert
all the fields to REAL to get by this? 4 9337
In Access
Open the table in design view
Accept the warning
Select the field you are concerned with
Change the Decimal places property in the bottom part of the screen to 4
Save and close the table.
--
Terry Kreft
MVP Microsoft Access
"digitalavatar" <rw*****@pcdatapartners.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com... I am having a problem with my Access 2000 front end to a SQL 7 or 2000 database. I create a table in SQL with a field named, say, amt, data type MONEY. When I link the table in Access using ODBC, the field is defined as CURRENCY, as expected. Now, if I use SQL to populate the field with a 3- or 4-decimal amount like 1.234, it appears in the Access table as 1.23 only. If I expand the decimals to 3 places it will be 1.230; if the orginal value was 1.236 it will be rounded to 1.240. It seems like Access or ODBC is rounding the SQL MONEY field to 2 decimal places. Both SQL and Access will support 4 decimal places. If I look at the SQL data using ADO from Access I get 4 decimal places returned as expected. Can anyone offer a suggestion before I convert all the fields to REAL to get by this?
Does the SQL actually say .1234, or are you generating the SQL somehow. Make
sure the number is actually what you think it is in the SQL text.
On 6 Jan 2005 13:25:12 -0800, "digitalavatar" <rw*****@pcdatapartners.com>
wrote: I am having a problem with my Access 2000 front end to a SQL 7 or 2000 database. I create a table in SQL with a field named, say, amt, data type MONEY. When I link the table in Access using ODBC, the field is defined as CURRENCY, as expected. Now, if I use SQL to populate the field with a 3- or 4-decimal amount like 1.234, it appears in the Access table as 1.23 only. If I expand the decimals to 3 places it will be 1.230; if the orginal value was 1.236 it will be rounded to 1.240. It seems like Access or ODBC is rounding the SQL MONEY field to 2 decimal places. Both SQL and Access will support 4 decimal places. If I look at the SQL data using ADO from Access I get 4 decimal places returned as expected. Can anyone offer a suggestion before I convert all the fields to REAL to get by this?
Thank you for your reply but I didn't make myself clear. Access will
show four decimal places, but the last two are zeros, e.g. 123.4500
when SQL has 123.4543. If you try to change the last two in Access and
update, you get the "copy to clipboard" etc etc message. You can get
rid of the message by adding a timestamp to the table but still no four
digits.
I have fixed it by converting the fields in question to real in SQL,
and formatting them (NOT data typing them) as currency in Access.
Thank you for your reply. The SQL data is actually .1234. In fact, if
you retreive the data with ADODB instead of ODBC you get .1234. I
don't have the time to recode everything at this point so I just
converted the data to real and use the Access currency format (not data
type) to display it. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Batista, Facundo |
last post by:
Here I send it.
Suggestions and all kinds of recomendations are more than welcomed.
If it all goes ok, it'll be a PEP when I finish writing the code.
Thank you.
.. Facundo
|
by: David Garamond |
last post by:
What do people recommend for storing money amounts? I've seen people use
NUMERIC(18,3) and other use NUMERIC(18,4). Which one is more appropriate
and why? This is considering various existing...
|
by: Philip Nelson |
last post by:
Folks,
I've been exercising my mind recently about the complexities of implementing
a "currency" data type within DB2 to cope with multiple currencies.
A monetary value is often simply...
|
by: Alberto |
last post by:
I have a decimal field in a SQL Server DataBase who stores money and I want
to show it in a TextBox and in a ListView controls in C#.
If I do: txtMoney.Text = Convert.ToSingle(dr);
I see...
|
by: Jensen bredal |
last post by:
Hello gurus,
How do i handle Currencies from "asp.net form field " to "insert " querry in
database?
The "money" is entered in a textbox and my code is falling to the stored
procedure due to...
|
by: xjohnx |
last post by:
Hi, I'm hoping someone can help me I am quite new to Javascript and have had to create a programme which converts dollars into euros and vice versa, here is my script which is working
var...
|
by: soni2926 |
last post by:
Hi,
I have the following:
float.Parse(myproduct.Price.Value.ToString());
myproduct.Price.Value.ToString() returns $24.00 (with the $)
Is there anyway to do the above cast, I know the...
|
by: mereba |
last post by:
Hello
My country Ghana is changing its currency. I want to write a small
programme in C++ that can covert from the old currency into the new
one. I would like this programme to run behind a simple...
|
by: bb |
last post by:
Hi,
Are there any open source data types ( c++ classes ) for Money and/or
Price that I can inherit and customize for my use instead of writing
from the scratch?
Any help would be much...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: Ricardo de Mila |
last post by:
Dear people, good afternoon...
I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control.
Than I need to discover what...
|
by: Johno34 |
last post by:
I have this click event on my form. It speaks to a Datasheet Subform
Private Sub Command260_Click()
Dim r As DAO.Recordset
Set r = Form_frmABCD.Form.RecordsetClone
r.MoveFirst
Do
If...
|
by: jack2019x |
last post by:
hello, Is there code or static lib for hook swapchain present?
I wanna hook dxgi swapchain present for dx11 and dx9.
|
by: DizelArs |
last post by:
Hi all)
Faced with a problem, element.click() event doesn't work in Safari browser.
Tried various tricks like emulating touch event through a function:
let clickEvent = new Event('click', {...
|
by: F22F35 |
last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...
| |