Date Conversion Functions

TO_DATE:-        It is used to convert the character datatype to Date datatype.
Syn:-                     TO_DATE(‘char date’);
EX:-                      insert into employ4 values(100,’prasad’,3200,
                                          to_date(’01-sep-02’,’dd-mon-yy’));
ADD_MONTHS:- It is used to add the months for the give date.
Syn:-         ADD_MONTHS(date,months)
Ex:-           select add_months(sysdate,4) from dual;
LAST_DAY:- It is used to display the last date of the month.
Syn:-         LAST_DAY(date);
Ex:-           select sysdate,last_day(sysdate) from dual;
MONTHS_BETWEEN:- It is used to display the months between two dates.
Syn:-         MONTHS_BETWEEN(date1,date2)
Ex:-           select months_between(’02-sep-02’,’01-mar-02’) from dual;
NEXT_DAY:-     It is used to display the date  to the given week.
Syn:-         NEXT_DAY(date,’char day’);
Ex:-           select next_day(’01-sep-02’,’friday’) from dual;

 

For
Online Classes

Contact Us: +919885348743