At 7/8/02 11:51 PM, 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.
The parentheses aren't in quite the right place. Try:
extract(month from (current_date + interval '1 month'))
That is, you want to add 1 month to the current date first (adding a date
and an interval), then extract the month number from the result of that.
Your version extracted the month integer first -- "8" -- then tried
adding an interval to it, but it doesn't make sense to add integers and
intervals together.
------------------------------------
Robert L Mathews, Tiger Technologies