tags:

views:

625

answers:

4

Group I am pasting data from SQL to Excel and it appears that Excel is trying to read my mind by converting some of my numbers to dates. I.e. one number is 2-2131 and when I paste it to excel it shows Feb-31 even 2-3291 wnats to be Feb-61

STOP IT EXCEL!

This is driving me crazy and I can't seem to find an easy way around this. I tried "paste special" as text and it still formats. I can get it to work if I create a connection and use the query, but I just want to be able to copy-paste data for testing purposes.

Anyone have an easy solution to my headache?

Thanks in advance!

A: 

Highlight the affected row, right click, choose Format Cells..., select Text before you paste the data.

toast
You have to format it before pasting the data
Tom H.
No - it actually changes it to a date
DJ
Yeah, just checked to be sure after I posted and noticed this. Very naughty on Excel's part.
toast
+8  A: 

Format the column as text before pasting the text.

Mark Brackett
Before or after makes no difference, the value of the cell isn't being changed
toast
Actually, just tried it and Excel is changing the values of stuff like 2-3121. That is nasty.
toast
+1  A: 

Select the cells ahead of time and mark the formatting as Text. (Format->Cells, select "Text" from Categories and click OK). Then paste your data.

Tom H.
A: 

After pasting the sql data to excel, change the date and time format of excel to simple numbers seprated by dashes. That way round even if excel would assume it to be date, it would display the numbers as it is.

stack programmer