Hellow, I have column "MyDate" in table "MyTable" in Sybase SQL. Column "MyDate" has type data and format of data is for example Jan 3, 1902. My question is how can I change format of present date from Jan 3, 1902 to for example 1902/01/03?
Could you write my whole code which can do it, not briefly answer please :) Thank you.
1 Answer
You can use
DATEFORMAT ( datetime-expression, string-expression )
UPDATE MyTable
SET MyDate= DATEFORMAT(MyDate,'NEW_DATE_FORMAT');Or you can use
CONVERT ( data-type, expression [ , format-style ] )
select CONVERT( CHAR( 20 ), MyDate, 104 ) from MyTable 4