DECLARE @dateCol datetime = '2015-06-10' , @VarCol VARCHAR(100)= '2015-06-10'SELECT CONVERT(VARCHAR(10), @dateCol, 105) AS [DD-MM-YYYY] ,CONVERT(VARCHAR(10), @VarCol, 105) AS VarcharColumn,CONVERT(VARCHAR(10), cast(@VarCol as datetime) , 105) AS VarcharColumnInDateFormat
DD-MM-YYYY VarcharColumn VarcharColumnInDateFormat 10-06-2015 2015-06-10 10-06-2015
Mark This Response as Answer -- Chandu http://www.dotnetfunda.com/images/dnfmvp.gif
Mark as Answer if its helpful to you Kumaraspcode2009@gmail.com
Login to post response