Looking for answer on how to code sql query (using IBM DB2 Version 7) where date will automatically calculate first of the month (i.e. where effective_date<'2005-03-01) Currently this date has to be manually changed each month to reflect the first day of the CURRENT month. If this query is run on 3/15/2005 - the data should still reflect only records where the effective date is <= the first day of the current month (3/1/2005 as in example above)
Been trying different options with Year(effect_date)<=year(current date) and month(effect_date)<month(current date)..but get stumped on isolating the days.
Any help would be appreciated. Thanks!
Been trying different options with Year(effect_date)<=year(current date) and month(effect_date)<month(current date)..but get stumped on isolating the days.
Any help would be appreciated. Thanks!