4 Replies Latest reply: Apr 1, 2010 9:33 AM by Les Backman RSS

    Current Year and Last Year Flags

      I am trying to put a CY and LY flag into my script but everything I try gives me errors.

      I am loading essentially one giant ascii with all my records. [INVC DATE] is only one of these fields. When i try this...

      [INVC DATE],

       

       



      date(monthstart([INVC DATE]), 'MMM-YYYY') as RollingMonth,

       

       

       

       

       

       

       

      date

       

      (yearstart([INVC DATE]), 'YYYY') as RollingYear,

       

      Month

       

      (Date([INVC DATE])) as Month,

      Weekday

       

      ([INVC DATE]) as WeekDay,

      Day

       

      ([INVC DATE]) as Day,

      Week

       

      ([INVC DATE]) as Week,



       

       

       

      Week

       

      ([INVC DATE])&'-'&Year([INVC DATE]) as RollingWeek,



       

       

       

       

      IF

       

      (year([INVC DATE])=$(vCurrentYear),1,0) AS CY_flag,



       

       

       

       

      IF

       

      (year([INVC DATE])=($(vCurrentYear)-1),1,0) AS LY_flag,

       

      I get Error in expression:')' expected

      Much appreciate some guidance here,