If you want to show or if you need the month first day, there is no built-in function in Oracle. But you can get it easily by using some other single-row date function. Here bellow an example of this.
SELECT LAST_DAY(ADD_MONTHS(SYSDATE,-1))+1
FROM DUAL;
Run the above sql and you will get the first day of current month. For last day of current month just use the LAST_DAY function like thisLAST_DAY(SYSDATE)
Need more help ? Just Leave you comments...
Cheers
SELECT LAST_DAY(ADD_MONTHS(SYSDATE,-1))+1
FROM DUAL;
Run the above sql and you will get the first day of current month. For last day of current month just use the LAST_DAY function like thisLAST_DAY(SYSDATE)
Need more help ? Just Leave you comments...
Cheers
This comment has been removed by the author.
ReplyDeleteu r welcome :)
ReplyDeleteThis post shows how to get/show first date of the month. The query for the same is given in this post. The query is simple and easy to understand. This command is easy to learn. Thanks for the post. Keep it up.
ReplyDeleteI have some useful DB scripts in my collection above a look here -- uses full DB scripts
ReplyDeleteThanks a lot for this
ReplyDeleteYou are welcome @rahul
ReplyDeleteINSTEAD OF THIS WHAT IS YOUR OPINION ABOUT THE FOLLOWING
ReplyDeleteSELECT TRUNC(SYSDATE,'MONTH') FIRST_DAY,
LAST_DAY(SYSDATE) END_DATE,
SYSDATE CURRENT_DATE
FROM DUAL;