First Day of a Month
An SQL that takes a date value such as 01/15/2008 and returns the first day of that month. In our example, the first day for Jan of 2008 is Tuesday.
Last Day of a Month
Fortunately Oracle has the LAST_DAY function to do that. Here is an SQL on how to use it.
| Title | Under | Posted on |
|---|---|---|
| How to run nvision report through portal | PeopleSoft Technical | 08/31/2010 - 4:45am |
| Any1 here who can help? | PeopleSoft Technical | 08/31/2010 - 2:12am |
| How to create matrix layout | PeopleSoft Technical | 08/27/2010 - 2:22am |
| UnCaught C++ Exception | PeopleSoft Technical | 08/10/2010 - 9:05am |
Comments
I was asked a question on how could we get the last day of the month if we only know the month (like 07 for july) and not the whole date? and here is how:
SELECT LAST_DAY (TO_DATE (:2, 'MM'))
FROM DUAL;
7/31/2008
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Post new comment