In one of my applications, I was reporting for exactly for month. So I took the date time parameter as month-year such as mar-2009. And then with this parameter I have searched in my database. But for the integration porpuse with the ERP system I need to send the month in first date - last date format. I really was in trouble. But oracle saved me
select last_day (to_date('12-09-2009', 'dd-mm-yyyy')) from dual
with this query you can get the last date of a month with any date of the month. You can apply this function on any date type field. And dont worry about the first date just put 01-month-year.
No comments:
Post a Comment