Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert String to date and add days to it.

Murali_SriniJul 4 2014 — edited Jul 4 2014

Hi folks,

I have two variables as shown and one of them is not in actual DATE format.

FE_AC_END_DATE is 'DEC2011'

FE_PR_END_DATE is 31-DEC-10

show to_date(FE_AC_END_DATE, 'MONYYYY')

01-DEC-10

How to make sure that after conversion i get it as 31-DEC-10.

It should always give me end of the month date and not the star of the month date.

say if FE_AC_END_DATE is 'SEP2009', then after conversion i should get 30-SEP-2009.

Is there away i can months to it?? What ever i do it has to be in a single line syntax. Any delivered function to use??

Secondly when you use BETWEEN to compare the date range would it also inlcude start and end range ????

For ex.,

WHEN END_DATE BETWEEN to_date(DATE1, 'MONYYYY') AND to_date(DATE2, 'MONYYYY')

What would happen if the END_DATE is equal to either DATE1 and DATE2? Would it still be treated as in BETWEEN ?

Appreciate your inputs.

This post has been answered by Russell Clay on Jul 4 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 1 2014
Added on Jul 4 2014
11 comments
3,245 views