Exporting bit values as "True" and "False" in Excel
frodriguez
Posts: 4 New member
Hello,
I have the following result table :
Status
1
0
If I were to export that in Excel via the "Open in Excel" context menu, my values are converted to "True" and "False" respectively for 1 and 0. Is there a way to preserve those values as 0 and 1?
This is on SQL Server 11. SQL Prompt is at version 9.1.2.4363.
I have the following result table :
Status
1
0
If I were to export that in Excel via the "Open in Excel" context menu, my values are converted to "True" and "False" respectively for 1 and 0. Is there a way to preserve those values as 0 and 1?
This is on SQL Server 11. SQL Prompt is at version 9.1.2.4363.
Tagged:
Answers
What type is your Status column? Is it an INT or a BIT?
You can try casting your Status column to INT. When you open this result in Excel, the values won't get converted. eg
Select Cast(Status as int) from yourTable;
I hope this helps, FabiolaI noticed something similar for NULL. The NULLs get converted to blanks.