Home » Other » Test » SQL (oracle 10g)
SQL [message #344845] Mon, 01 September 2008 06:57 Go to next message
udeshi
Messages: 1
Registered: September 2008
Junior Member
select add_months(to_date('29/02/2008','dd/mm/yyyy'),'1') from dual";

SQL result>---3/31/2008 12:00 AM

But correct answer should be 29/03/2008 12:00 AM
help...
Re: SQL [message #344848 is a reply to message #344845] Mon, 01 September 2008 07:05 Go to previous messageGo to next message
Michel Cadot
Messages: 68729
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
This forum is for testing post not SQL test.
If you wanted to test your post, this was the correct forum but you failed, please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

If you wanted to post a real SQL question then post it in SQL forum but after reading the previous.

Regards
Michel
Re: SQL [message #347306 is a reply to message #344845] Thu, 11 September 2008 04:53 Go to previous messageGo to next message
saqibmunir
Messages: 1
Registered: September 2008
Location: Lahore - Pakistan
Junior Member
if you use add_months function the on last day to the month it will give you last day of the added or subtracted months. it is not work only adding 30 days.

Hope you understand.
Re: SQL [message #347316 is a reply to message #347306] Thu, 11 September 2008 05:07 Go to previous message
Michel Cadot
Messages: 68729
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
If you are testing how to reply in a topic, this is the correct place and you succeeded.

If you are answering the question, you have to know the posts in this forum are not to get an answer but just to test how to post.

Regards
Michel
Previous Topic: long running query
Next Topic: PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
Goto Forum:
  


Current Time: Mon Dec 30 10:48:48 CST 2024