Interval year to month

Hi,
I'm working on a Informix4gl module. I'm just trying to find out any built-in function to fetch only the year/month from an INTERVAL YEAR TO MONTH data value.

Please let me know, if there are any functions to do this. If not, let me know for any alternative solutions to attain this.

Thanks

Hi.

I work with Informix too, but i really don�t understand your question. Do you want to get only "year" of a year-month value?

---------- Post updated at 11:56 AM ---------- Previous update was at 10:38 AM ----------

Do you find anything as this?

define
   var interval year to month,
   my_year smallint,
   my_month smallint

main
   let var = "2010-06"
   let my_year = year(var)
   let my_month = month(var)

   display "Var: ", var
   display "Year: ", my_year
   display "Month: ", my_month

end main

The Year() and Month() funciton returns only "0" and not a valid value.

What Informix 4GL version do you use ?

My IBM INFORMIX-4GL Version 7.32 returns:

Var:    2010-06
Year:     2010
Month:      6

:confused:

My version is 7.30

Have you tried my test?

Do you "compile" with c4gl or fglpc ?