?
Solved

Displaying date as dd/mmm/yyyy in sql server

Posted on 2005-03-15
2
Medium Priority
?
7,204 Views
Last Modified: 2009-10-05
Is there a way in SQL server to set the default date format to dd/mmm/yyyy ?  
0
Comment
Question by:q2004
[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 Comments
 
LVL 15

Accepted Solution

by:
mcmonap earned 2000 total points
ID: 13543823
Hi q2004,

Dates are always stored the same in MS SQL server, YYYY-MM-DD HH:MM:SS.mss, you can change the output format with a select using the convert function, as below:

--this returns the datetime now (in default SQL format)
SELECT getdate()

--this returns the date formatted as you want it
SELECT CONVERT(VARCHAR(11),getdate(),113)

More info on convert can be found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ca-co_2f3o.asp
0
 

Author Comment

by:q2004
ID: 13544976
That worked, thanks!

Q
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

752 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