开发者

how to convert date in oracle

I have a date in the format of:

27-MAY-09 12.00.00.000000 AM

I want to convert it to:

05/27/2009

I did to_char(my_dat开发者_JAVA技巧e_variable, 'MM/DD/YYYY') however that gives me character to number conversion error

what can I do to convert this date?

my_date_variable is declared as:

my_date_variable VARCHAR2(40);


You must first convert my_date_variable from VARCHAR2 to TIMESTAMP:

to_char(to_timestamp(my_date_variable), 'MM/DD/YYYY')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜