Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Decimal in SQL - as whole number in Access

Author  Topic 

J
Starting Member

5 Posts

Posted - 2004-10-11 : 17:30:45
I have a table in SQL2000 with a field with a datatype as decimal. I use a view on that table and have linked the view to an Access front end.

The issue is in SQL - the view looks great ie. value in field is 999.75, but in Access the view does not reflect the decimal point as it should and does in SQL it shows 999.

Thoughts? Suggstions?
Thanks Judy

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2004-10-14 : 03:46:14
hmmm - hadn't noticed that before- but yes, same for me.

I suggest you link to a view instead of to the table directly, with the decimal cast as a float...that works ok.

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-10-14 : 06:48:37
Most of the 4GLs I've seen don't properly [Edit: "Inherently" I should say] handle the DECIMAL type. Shame really, and surprising if Access doesn't handle it properly

Kristen
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2004-10-14 : 09:09:34
In Access, remember things may be displayed a certain way when you browse the tables, but the true value may be in there. Try writing a report or using the formatting options to add some decimal places to that column in a query to see if the true value displays.

Access 97 has trouble with decimal datatypes -- I believe it brings them over a text (!) -- but Access 2000 internally supports decimals so I think it should have no problems bringing them over. Certain precisions may cause problems, though. What is the exact declaration of the DECIMAL() datatype you are using in SQL Server?

One more thing -- in Views which Access or ADO might be using, I usally convert most non-integer datatypes to MONEY, since i rarely need more than 4 decimal places and that datatype is natively handled by both Access and ADO. I've had trouble in the past with ADO and decimal datatypes as well, but converting to MONEY explicitly usually solves this. Don't be put off that Access, by default, formats the data with your currency symbol, remember it's only formatting.

i hope some of this helps -- sorry for the rambling.

- Jeff
Go to Top of Page

J
Starting Member

5 Posts

Posted - 2004-10-20 : 16:33:31
Ironically I changed my views to sprocs and called them as my record sources in Access - and the problem resovled itself. Thanks for all the suggetions.

J
Go to Top of Page
   

- Advertisement -