Solved

date in MMDDCCYY format

Posted on 2014-04-29
4
1,593 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

839 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