Could you please suggest me how to convert the string value '4/6/2013' to date,
string value coming in different formats
You may try to cast the string value to date format...
cast (string_value as date format 'YYYY/MM/DD')
Since you have 4/6/2013 you could concatenate a zero (0) to the first character...and then apply cast...
How to convert string to Date :
String 'DD-MON-YY' To Date 'YYYY-MM-DD'
ex: 28-jan-13 to convert to date as '2013-01-28'
Can any one help me to convert this..
Thanks in advance....
my Table is having the date filed format YYYY-MM-DD
need the output to be in this format --- MMMM-DD-YY
a FORMAT is only applied when the column is CASTed to a string:
CAST(CAST(date_col AS FORMAT 'mmmm-dd-yy') AS VARCHAR(15))
TRIM(CAST(date_col AS FORMAT 'mmmm-dd-yy'))
i am getting an error
SELECT CAST(CAST(JDATE AS FORMAT 'MMMM-DD-YY') AS VARCHAR(15))
(CAST(JDATE AS FORMAT 'MMMM-DD-YY')) FROM USER_DBC.DUM;
expected some ting between ) TRIM Keyword?