tags:

views:

107

answers:

3

hi, i have to get the last day of the current month. how can i get

+3  A: 
set dateformat dmy

select dateadd(d, -1, dateadd(m, 1, '01-' + convert(varchar, month(getdate())) + '-' + convert(varchar, year(getdate()))))

add one month to the first of this month, minus one day.

thank you it is working fine
Surya sasidhar
A: 

Oracle

SELECT LAST_DAY(SYSDATE) AS Last_day_of_month FROM DUAL;

SQL Server (Copied from gabe's link)

SELECT dateadd(day, -day(getdate()), dateadd(month, 1, getdate())) AS Last_day_of_month
beach
A: 

SQLite (sqlite3)

Compute the last day of the current month.

SELECT date('now','start of month','+1 month','-1 day'); 

checkout this link as well if your using sqlite3 sqlite datetime functions

galford13x
ya it is working
Surya sasidhar