Following is my query
Following is my table structure
Table Name: Person
ID: (PK,int, not null)
Name: (Nvarchar(20),null)
BirthDate : (Datetime,null)
Following is my query
select Name,BirthDate From Person
Output is as follows
Name BirthDate
Sam 1986-01-01
Bob 2001-04-07
John 2000-02-02
Output in CSV
Name BirthDate
Sam 00:00.0
Bob 00:00.0
John 00:00.0
In order to export this content to csv all i do is select the values and right click on the output window with "copy with headers" option. it creates the CSV fine but when i open the file i get BirthDate as 00:00.0 for all three values. I don't understand what's causing this. Please help.
Change the output to:
Name;BirthDate
Sam;"1986-01-01"
Bob;"2001-04-07"
John;"2000-02-02"
This way in Excel the dates will show normally (I added ";" as sep but of course this can be tab or anything else).
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments