Getting the last_day in a SQL variable

From: David Pintor <>
Date: Fri, 10 Jul 2009 12:20:49 +0100
Message-ID: <>

Hi guys,

I'm trying to do a sql script (please see below) but i cant figure out how to get in a variable the value of the LAST_DAY in a month... any tips?

accept month prompt 'Enter Month [MON]:'; accept year prompt 'Enter Year [YY]:';

def lastday=LAST_DAY(&month);

select count(distinct(ppsn))
from award_result
where to_date(date_awarded, 'DD-MON-YY') >= '01-&month-&year' and to_date(date_awarded, 'DD-MON-YY') <= '&lastday-&month-&year';



Received on Fri Jul 10 2009 - 06:20:49 CDT

Original text of this message