Solved

sql date excel format

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
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 brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
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…

617 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