?
Solved

sql date excel format

Posted on 2009-07-13
3
Medium Priority
?
258 Views
Last Modified: 2012-05-07
Greetings,

When I run the following query, I export the results of the query to excel.

Problem here is that the date appears in Exel in the format of 2009-07-13

I would like the format to be 7/13/2009

We are using sql server 2005

Any help is appreciated

Sorry, I forgot to show you what I had tried:

SELECT     CONVERT(DATETIME, CONVERT(VARCHAR(20), eventDate, 102), 102))  
from myTable.

Open in new window

0
Comment
Question by:sammySeltzer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 200 total points
ID: 24840185
Date will be stored in the format 2009-07-13 in SQL Server.

If you want to view date in the format 7/13/2009, then this will do

SELECT CONVERT( varchar(10), CONVERT(datetime, '2009-07-13', 101), 101)
0
 
LVL 29

Author Comment

by:sammySeltzer
ID: 24840366
thanks a lot - it worked
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 24840380
Welcome and glad to help you out.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question