![]() |
#1
|
|||
|
|||
![]() Dear all, some times i need to save result set of sql server in .csv format and then need to save in xls format with out loosing any precision , i have some decimal values and some bigint values, 2003 ms offices gives option to set each columns type while opening any .csv file , is it the only way i can preserve the type or is there any other easy was because some times number of cols are more. yours sincerely |
#2
|
||||
|
||||
![]()
Raje, are you saying that when you open a .csv file in Excel, you're losing some precision? The VBA language has different data types that require more or less bytes of storage, but I'm not aware that Excel does that; I think every cell's numeric value has the same precision, no matter what of numeric data is in there.
I can imagine writing a VBA program that would a) read a .csv file as text, b) look at each incoming value to see how many digits of precision it has, c) store that value in the correct datatype (eg Integer, Long or LongLong) and finally d) copy the imported value into an Excel worksheet. But as soon as the data is placed in Excel, isn't the result going to be exactly the same? If you think you're losing precision, please post a copy of an example, a .csv file that can't be read into Excel 2010 without losing digits. I can easily believe that; but I think my response is going to be "but you were losing precision when you read it into Excel 2003 too". Maybe it let you set the data type when you read it in (though I don't remember it), but the internal storage was the same in all cases. One possibility: Are you sure you're not thinking of text importing? There, yes, you can tell Excel what sort of data you're reading in—text, dates, or "General"—but even there you're not talking about different precisions. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to import letterhead?? | kevinbeans | Word | 12 | 10-16-2013 10:20 AM |
Import from Evernote | KathleenC | OneNote | 0 | 08-28-2013 10:40 AM |
![]() |
Lensmeister | Outlook | 1 | 04-23-2012 03:08 AM |
import emails, contacts from Apple Mail to Outlook 2003 | hippo430 | Outlook | 0 | 02-15-2009 05:53 PM |
BCM import | Magic2 | Outlook | 0 | 12-04-2008 09:49 AM |