Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

DATETIME To Format mm/dd/yyyy hh:mm am/pm

$
0
0

 

I have a column in a database set as a DATETIME datatype, when I select it, I want to return it as:

 

mm/dd/yyyy hh:mm am or pm.

 

How in the world can I do this? I looked at the function CONVERT() and it doesnt seem to have this format as a valid type. This is causing me to lose my hair, in MySQL it is just so much easier. Sad.

 

At any rate, currently when I select the value without any convert() it returns as:

 

June 1 2007 12:23AM

 

Which is close, but I want it as:

 

06/01/2007 12:23AM

 

Thanks!


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>