On Tuesday 09 Jul 2002 12:21 am, Hunter Hillegas wrote:
> I am trying to execute this little bit:
>
> (extract(month from current_date) + interval '1 month')
>
> The system says I need to cast because it can't figure out how to add
> these... I read through the manual and I am still a little confused.
Try:
select extract(month from (current_date + interval '1 month'));
date_part
-----------
8
You want to add an interval to a date. It probably doesn't make sense to add
an interval to a month.
Alternatively:
select extract(month from (current_date)) + 1;
But that wouldn't deal with wrap-around in December.
- Richard Huxton