date in MMDDCCYY format

How to convert a datetime field to MMDDCCYY in a select statement
Star79Asked:
Who is Participating?
 
Kyle AbrahamsConnect With a Mentor Senior .Net DeveloperCommented:
SELECT replace(convert(VARCHAR, getdate(), 101) , '/', '') myDate
0
 
plusone3055Commented:
SELECT CONVERT(VARCHAR(10), SYSDATETIME(), 101) AS [MMDDYYYY]
0
 
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
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
 
plusone3055Commented:
JH
That  article is sweet !
thanks for sharing
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.