Q:

convert datetime to varchar(50)

Need help in converting datetime to varchar as in given format
2015-01-04 16:07:37.000"

to
01/04/2015 16:07PM

Here is what tried:
convert(varchar(20),datetime,103)+ ' '+convert(varchar(20),datetime,108)+ ' ' +right(convert(varchar(30),datetime,109),2)

A:

this will work in sqlserver SQLFiddle regarding this Demo
SELECT convert(varchar, getdate(), 103) 
+' '+ CONVERT(varchar(15),CAST(getdate() AS TIME),100)

