Reading 1.999999 from excel when the value is 2
Hi Gurus,
I have observed a weird thing with excel source in SSIS. I was reading few file yesterday and I observed that it is reading as 1.99999 for 2 value like for other values too. I thought rounding up that col but I have been told I might be getting values like
1.1.1.1 in that col in the future Like:
Col1
1
1.1
1.2
1.3
In future I might get values like
col1
1
1.1
1.1.1
1.2
1.2.1 etc.
Please help me how to load the right values into db.
August 17th, 2012 2:07pm
Not sure I understood, but it seems you want to preserve the formatting. For this purpose revise the connection string of the Excel Source (advanced properties) to include ;IMEX=1 directive. Then make sure the source metadata for this column us set to
a stringArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
August 17th, 2012 2:13pm
Not sure I understood, but it seems you want to preserve the formatting. For this purpose revise the connection string of the Excel Source (advanced properties) to include ;IMEX=1 directive. Then make sure the source metadata for this column us
set to a string
Arthur My Blog
Hi ArthurZ,
whats happening was, when I am reading few excel files even though excel files shows 1.2 after loading into my table it is showing as 1.9999. It is only happening with few values. Other values reading fine.
I tried like you mentioned above but getting same results.
My connetion string looks like this.
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\server\share$\filename.xlsx;Extended Properties="EXCEL 12.0 XML;HDR=YES;IMEX=1";
August 17th, 2012 2:23pm
Are you sure it is not 1.9999 in Excel?
Try saving it as a CSV file to see the exact valuesArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
August 17th, 2012 2:35pm
Are you sure it is not 1.9999 in Excel?
Try saving it as a CSV file to see the exact values
Arthur My Blog
Yes they are like 1.2 ,1.3 in Excel.As I mentioned it is only with few values other values like 1.6,1.7,1.8 values are showing correclty.
I can try saving it as CSV but my users will be dropping excels. so Ineed to fix this anyhow.
August 17th, 2012 2:55pm
Excel precision for decimal numbers are 6 digits after decimal. more than that then Excel rounds its off and shows only 6 digits after decimal. Can you confirm if when you select the value in excel sheet the value show in the function box (the box on the
top which shows value in the selected field) is the same? I doubt that the field value may be visible as 2 but in the function box it would be different.Please mark the post as answered if it answers your question
Free Windows Admin Tool Kit Click here and download it now
August 17th, 2012 4:43pm
Excel precision for decimal numbers are 6 digits after decimal. more than that then Excel rounds its off and shows only 6 digits after decimal. Can you confirm if when you select the value in excel sheet the value show in the function box (the box
on the top which shows value in the selected field) is the same? I doubt that the field value may be visible as 2 but in the function box it would be different.
Please mark the post as answered if it answers your question
Nope it is showing as same in the function box too.
1.2 is showing as 1.2 only.
August 17th, 2012 4:49pm
I solved it by making the problem field as Text in the excel file.
Free Windows Admin Tool Kit Click here and download it now
August 28th, 2012 4:01pm