This content has been marked as final. Show 3 replies
KaiS wrote:Always pass (at least) 2 arguments to TO_TIMESTAMP, like this:
SELECT SYSDATE FROM DUAL;
SELECT * FROM stables AS OF TIMESTAMP TO_TIMESTAMP ('11-MAY-2011 14:30:00'); returns
ORA-01849: hour must be between 1 and 12
The second argument tells TO_TIMESTAMP what format you're using. If you don't pass it, then TO_TIMESTAMP will use some default format, which may not be what you want or expect.
TO_TIMESTAMP ( '11-MAY-2011 14:30:00' , 'DD-MON-YYYY HH24:MI:SS; )