RE: date time conversion 12 months out

RE: date time conversion 12 months out

 

  

John-
The ADD_MONTHS function will do this for you.

ADD_MONTHS(date,n)

so that to_char(add_months(datetime_v,12),'MM-DD-YYYY HH24:MI:SS')
will return a date twelve months out from datetime_v

This usage of to_char is probably a typo?
to_char(name,null,'DD-MON-YYYY:HH:MI:SS'

-----Original Message-----
From: johnandsteff
[mailto:oracledba-ezmlmshield-x65764483.[Email address protected]
Sent: Friday, January 28, 2005 12:27 PM
To: LazyDBA Discussion
Subject: date time conversion 12 months out

We're using Oracle Designer to do our design.

We're doing a trigger that that will submit a DBMS_JOBS for every 12
months.

When I code to_char(name,null,'DD-MON-YYYY:HH:MI:SS' I want to take the
sysdate and add 12 (for 12 months). I get an error that's it's invalid
type.

Can any one tell how to write a to_char date conversion with 12 months
out ?

Thanks.

John DeUnger





--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com To unsubscribe:
see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com By using this list you agree
to these terms:http://www.lazydba.com/legal.html


--
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.

Douglas County, Oregon
www.co.douglas.or.us


Oracle LazyDBA home page