Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.data.oledb,microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OLEDB rounding percents incorrectly?

Hi,

I am running SS2000 SP4 and loading Excel 2003 SP2 files using a
VB.NET 1.1 console app.

It uses the following OLEDB connection parameters
Product = 'Excel'
Provider = 'Microsoft.Jet.OLEDB.4.0'
ProviderString Thing = 'Excel 8.0; HDR=NO; IMEX=1;'

In the registry... in the right place!
ImportMixedTypes = "Text"
TypeGuessRows = "0"

Also...
Tools | Options (Calculations) Precision As Displayed checkbox is Off
(I don't really want to have to switch it on. The Excel file is a
controlled document)

It works very nicely except for...

I have a percent field that is a formula that is displayed to 2
decimal places. There is no rounding around the formula. (It needs to
be like this because averages are calculated from this field, among
others, i.e. more accurate average)

1. The actual value using a calculator is
0.079446808510638297872340425531915 and it displays correctly as 7.94%
2. Copying the cell contents and Paste Special (Value) in a new sheet
results in 0.079446809

Yet, when I suck the data into a datatable in VB.NET or read it from
QA using a linked server, I get a value of 7.95%. In other words the
OLEDB driver is doing some stuff.

The only way I can turn 0.079446809 or 7.9446% into 7.95% is to round
it to 3 and then round it to 2.

What is going on here or am I missing something simple?

Regards

Liam

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
percents assaf1978 Excel Discussion (Misc queries) 2 November 2nd 08 10:30 AM
Percents Sharon Excel Worksheet Functions 4 April 1st 08 12:48 PM
Percents Can''t get it Excel Discussion (Misc queries) 3 March 25th 08 01:21 PM
Percents and Text in one cell - need to add percents only elfmajesty Excel Discussion (Misc queries) 3 March 24th 06 08:46 AM
Percents Colchabay Excel Discussion (Misc queries) 5 February 28th 06 05:28 PM


All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"