Link to home
Start Free TrialLog in
Avatar of Curtis Long
Curtis LongFlag for United States of America

asked on

SQL to Excel Dates

I am importing dates from MSSQL 2008 R@ to Excel 2013

The dates come in as text and I have to do the "Text to Columns" every time I import.

Is there a way to make them come in as dates so I do not have to convert them every time??
Avatar of John_Vidmar
John_Vidmar
Flag of Canada image

If you used Get External Data from the Data ribbon then your import should retain data-types.  In your SQL database-table, are the date-fields defined as datetime or varchar?  If they are defined as varchar then you could CAST into datetime by altering the SQL generated by Excel.
Avatar of Curtis Long

ASKER

they are defined as date.

I could change these simply if there is a better format.
I am currently using the tab "From Other Sources" under the "Get External Data" tab.

Under that i use the "From SQL server" option
ASKER CERTIFIED SOLUTION
Avatar of John_Vidmar
John_Vidmar
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks!!