January 29, 2013 at 1:23 pm
I ran the query below and then copy result to Excel but missing "0" at front for [MemberID] (varchar)
Select MemberID from Member
Data in SQL table is like below:
MemberID
05368
13698
Data in Excel is like below:
5368
13698
How to fix it?
January 29, 2013 at 1:39 pm
Before copying, format the column as Text.
Alternatively, you can use
SELECT '''' + MemberID AS MemberID FROM Member
to add an apostrophe before the string so Excel will treat it as text without changing the value.
January 29, 2013 at 1:42 pm
How to format?
Result is displaying in SQL management studio.
January 29, 2013 at 1:45 pm
Format the column in Excel before it gets the data.
January 29, 2013 at 1:50 pm
Usualy I just copy from result window in SQL and then paste into first cell of Excel.
I'll try your way.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply