I want to convert given date into the format YYYY-MM-DD
.
Given date:
DECLARE @Date1 VARCHAR(50) = '30-01-2015'
Now I want to convert it into the 2015-01-30
.
My try:
Try1:
SELECT CONVERT(VARCHAR(50),'30-01-2015',126)
Try2:
SELECT CONVERT(VARCHAR(50),'30-01-2015',120)
For both try the result remain same that is 30-01-2015
.
date
. – Maurey