Kartier Pohs

Monday, June 15, 2015

DATE FUNCTIONS in SQL

DATE FUNCTIONS :- In order to process and manipulate dates,Oracle provides a number of functions that operate on various date related datatypes in oracle.The default date format in Oracle is DD-MON-YY and default time format is HH:MI:SS.
 The various date  functions are described below.

1-Command :- SYSDATE
Purpose :-  It returns the current date and time of the system.
Example :-

DATE FUNCTIONS in SQL
2-Command :- ADD_MONTHS(date,n)
Purpose :- It adds or subtracts n number of months to/from a date value.
Example :-

DATE FUNCTIONS in SQL3-Command :- LAST_DAY
Purpose :- It returns the date of last day of the month.
Example :-

DATE FUNCTIONS in SQL
4-Command :- NEXT_DAY
Purpose :- It returns the date value of next named day after given date.
Example :-

DATE FUNCTIONS in SQL
5-Cammand :- MONTHS_BETWEEN(date2,date1)
Purpose :- It  determines the number of months between date2 and date1.
Example :-

DATE FUNCTIONS in SQL

No comments:

Post a Comment

Copyright 2015 @ Yogesh Prasad