I’ve been using syntax like {?EndDate} - INTERVAL '1' YEAR for a while now, and I knew there was an issue that I was going to hit eventually, and I just hit it. I tried to do DATE '2010-12-31' - INTERVAL '6' MONTH, and it choked because there’s no June 31st. What’s the most efficient and consistent way to code this? While tracking down the person who made the decision to do it this way would be more satisfying, it’s impractical. 🙂
I’ve been using syntax like {?EndDate} – INTERVAL ‘1’ YEAR for a while now,
Share
I am not sure if there is a constistent way, since it certainly depends on what someone thinks is 6 months. Yet, imho, it is safe to assume that
add_monthsis a standard way (at least in Oracle) to subtract or add months:This expression returns June 30th 2010 (which is the last day in that month (as is the 31st in december).