Update a DATE field in Oracle 10g

mrong
mrong used Ask the Experts™
on
Greeting,
I want to update a date field to the date of the previous month. Say I have 15-JUL-09 in the table now and I want to update it to 15-Jun-09. I need a update stmt in oracle.

thanks in advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Billing Engineer
Most Valuable Expert 2014
Top Expert 2009
Commented:
simple:
http://www.techonthenet.com/oracle/functions/add_months.php
UPDATE yourtable
   SET yourfield = add_months(yourfield, -1)

Open in new window

if u want only date than mention to_date(yourfield)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial