Solved

date in MMDDCCYY format

Posted on 2014-04-29
4
1,551 Views
Last Modified: 2014-04-29
How to convert a datetime field to MMDDCCYY in a select statement
0
Comment
Question by:Star79
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 350 total points
ID: 40030346
SELECT replace(convert(VARCHAR, getdate(), 101) , '/', '') myDate
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 40030350
SELECT CONVERT(VARCHAR(10), SYSDATETIME(), 101) AS [MMDDYYYY]
0
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 150 total points
ID: 40030370
In addition to Kyle's correct answer, SQL expert PortletPaul wrote an article on SQL Server Date Styles (formats) using CONVERT() that is an excellent cheat sheet on converting dates.
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 40030377
JH
That  article is sweet !
thanks for sharing
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

815 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now