>select iif(yearmonth=200510,200510) as yearmonth1, >iif(yearmonth=200511,200511) as yearmonth2, >iif(yearmonth=200512,200512) as yearmonth3, >iif(yearmonth=200601,200601) as yearmonth4, >iif(yearmonth=200602,200602) as yearmonth5, >iif(yearmonth=200603,200603) as yearmonth6, >iif(yearmonth=200604,200604) as yearmonth7, >iif(yearmonth=200605,200605) as yearmonth8, >iif(yearmonth=200606,200606) as yearmonth9, >iif(yearmonth=200607,200607) as yearmonth10, >iif(yearmonth=200608,200608) as yearmonth11, >iif(yearmonth=200609,200609) as yearmonth12 >from mytable into cursor newtable >>
ldDate = date(2005, 11, 1) ? left(dtos(gomonth(ldDate, 3)), 6) && As string ? val(left(dtos(gomonth(ldDate, 3)), 6)) && As numericBy the way, the iif(), as posted, would give an error message, since there are only two parameters. Probably there is a third parameter which you forgot to post.