Hi All,
How I can get the 1st day of the month, I mean let's say today date is 20-JUL-05 and I need 01-JUL-05.
Thanks in advance
Printable View
Hi All,
How I can get the 1st day of the month, I mean let's say today date is 20-JUL-05 and I need 01-JUL-05.
Thanks in advance
No problem; I got it. below is the solution
SELECT '01-'||to_char(sysdate,'MON-YY') FROM DUAL
Here is a more elegant yet simple solution that returns a date instead of a string:Quote:
Originally Posted by aph
If you still want the date as a formatted string:Code:select trunc(sysdate,'mon') first_of_month
from dual
Code:select to_char(trunc(sysdate,'mon'),'DD-MON-YY') first_of_month
from dual