Solved

date in MMDDCCYY format

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

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

20 Experts available now in Live!

Get 1:1 Help Now