SQL date formatting

Hello all,
I have a date time column DispensedDate which has values like :2012-06-07 00:00:00.000.
How to convert this to MM/DD/YY in a query
Star79Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Guru JiConnect With a Mentor Commented:
SELECT convert(varchar, getdate(), 101) – mm/dd/yyyy - 10/02/2008
0
 
Guru JiCommented:
replace getdate() with your date column
0
 
AverittegCommented:
Try:
SELECT CAST(table.DispensedDate AS DATE) AS DispensedDate
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Star79Author Commented:
hello all,
I need it like
MM/DD/YY
Note the year its only YY
0
 
tim_csConnect With a Mentor Commented:
Replace his 101 with just 1.
0
 
AverittegCommented:
Select CONVERT(VARCHAR(11),DispensedDate,1) as Dispensed Date from table

Tim_cs was correct: this version works just fine in a sql query. Tested success in Sql 2008.
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.