! --------------------- ---------- ------------------------------------------ ! ! Name ! last_day.sqr ! ! Description ! ! This program accepts a date as input and outputs the last day of the month ! ! Parameters ! $input_date ! ! Modification History ! ! Name Date Comment ! --------------------- ---------- ------------------------------------------ ! Eric Eastman 2002-05-03 Created begin-setup declare-variable date $input_date $first_day_of_month $last_day_of_month end-declare end-setup begin-program input $input_date 'Enter Date' type=date format='YYYY/MM/DD' move $input_date to $month_year YYYY/MM concat '/01' with $month_year let $first_day_of_month = strtodate($month_year, 'YYYY/MM/DD') let $last_day_of_month = dateadd(dateadd($first_day_of_month, 'month', 1), 'day', -1) show $last_day_of_month edit 'Month DD, YYYY' end-program