Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date help 1

Status
Not open for further replies.

gtb12314

Programmer
Jan 7, 2008
41
US
Hi there,

Please help me out, I want to know what will be the code in oracle 9i for the following line of code, I tried several ways but not yet solved.

I mean I want to transform the following code into oracle 9i SQL.

dateadd('yyyy',-1,(date(year(datadate)-1,month(datadate),1)))

Any suggestion.

Thanks in advance
 
This looks to me like you're trying to get the date of the first day of the current month from 2 years ago, correct?

Try this (you may have to tweak for syntax....)

Add_Month(To_Date(to_char(sysdate,'MM')||'/01/'||to_char(sysdate, 'yyyy'), 'MM/dd/yyyy'), -12)

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top