I have seen reference on the web to formatting the CSV files as:
Code:
ABC,="001234",Four-digit code
ZYX,="012345",Five-digit code
And reports are that is works. However, in my Excel 2007 this imports exactly as specified -- that is B1 is ="001234" and B2 is ="012345" . Perhaps MS 'fixed' this in 2007 and it may work for you.
Other than this, I know of no way to force Excel to read what appears to be a numeric value as text from a .CSV file.
The SQL for this: Code:
SELECT...
'="' + right('000000' + ProductCode, 6) + '"' as [Product Code]
[edit] silly me, the column value already has the leading zeros, so the right function is not necessary[/edit]
Bookmarks