Solved

sql date excel format

Posted on 2009-07-13
3
248 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 50 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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

Suggested Solutions

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 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