Formatting Dates in Excel through SQL Connection

I have an excel spreadsheet with a column formatted in mm/dd/yy format.
I set up a connection to pull this date in from a view in a SQL server database.  However, when it pulls in, it appears in the format yyyy-mm-dd.  It ignores the formatting of the spreadsheet.   If I adjust the view to using a CAST function to format the date the way I want, it works.  But I was wondering if there was any other way this can work without using CAST?

In the original table, the field where date is being pulled from is of datatype 'date'.  

Thanks
mak345Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
>But I was wondering if there was any other way this can work without using CAST?
Nope.  Dates are stored as YYYY-MM-DD HH:MM:SS, and SQL Server is not going to accept the formatting of an Excel spreadsheet column's date formatting as how the date in the SQL table should be stored.

Any changes will require a CAST or CONVERT, such as CONVERT(varchar, YourDateColumn, 102)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
btw if this is on SQL 2012 you have available the new FORMAT() function
SELECTFORMAT(YourDateColumn, 'mm/dd/yyyy')
0
mak345Author Commented:
Thanks.
0
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Thanks for the grade.  Good luck with your project.  -Jim
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.