PL/SQL (MOSC)

MOSC Banner

Date field does not get updated correctly

edited Oct 14, 2013 10:24PM in PL/SQL (MOSC) 6 commentsAnswered
I have a date field in my table that is set to today's date. i need to change it to yesterday so I ran:

UPDATE table1 SET field1=TO_DATE('13-OCT-13','DD-MON-YY') WHERE field2='TEST'

It seems to have update the date but day of the week still shows up as Monday instead of Sunday.

When I run

SELECT TO_CHAR(TO_DATE( FIELD1, 'DD-MON-YY'),'DY') FROM TABLE1 WHERE FIELD2='TEST'

I get

'MON' returned, even though the date is '13-OCT-13', which is a Sunday.

How can I fix that?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

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