First date of the current month [message #371245] |
Fri, 22 September 2000 12:11 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Salman Khan
Messages: 51 Registered: September 2000
|
Member |
|
|
Hi,
Is there any function which give the first date of the month. I know there is last_day function but Iam looking for first day.
Like 1-Sep-00
Thanks in Advance
Salman Khan
|
|
|
|
|
|
How about that one [message #371251 is a reply to message #371249] |
Fri, 22 September 2000 15:36 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Salman Khan
Messages: 51 Registered: September 2000
|
Member |
|
|
How about that statment. Let me know if its still wrong.
Thanks
Salman Khan
select (last_day(sysdate)-30)+decode(substr(last_day(sysdate)-30,1,2),31,+1,-1) from dual
|
|
|
|
|
intersting one [message #371286 is a reply to message #371249] |
Thu, 28 September 2000 04:00 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Rajendra
Messages: 23 Registered: September 2000
|
Junior Member |
|
|
why not try this one.
select decode(substr(last_day(sysdate),1,2),'30',last_day(sysdate-30)+1,
'31',last_day(sysdate-31)+1,'28',last_day(sysdate-28)+1,'29',last_day(sysdate-29)+1,null) from dual
enjoy...
Rajendra
|
|
|
|