SQL Language (MOSC)

MOSC Banner

To_char Date format

edited July 2012 in SQL Language (MOSC) 5 commentsAnswered ✓
Hi,

I am using Oracle 10G.

when I am using the following sql query, it's returning me the desired output.

select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') as "Current Time"

from dual;

But when I am changing 'SYSDATE' with some value it's throwing me the error - ORA - 01722 (Invalid Number).

select to_char('07/08/2012 23:05:00','MM/DD/YYYY HH24:MI:SS') as "Current Time"from dual;Please help me out.Thanks.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center