3 Replies Latest reply: Jul 4, 2014 3:01 AM by Jitendra Vishwakarma RSS

    getting max value from table and storing to a variable in script.

      Dear Team,

      i want to get max value from a table assign that value to a variable and then use same variable to a load statement. please help what i am doing wrong i am getting null value in the variable.

       

       

      temp:

       

       

      LOAD max(WEEKNO) as maxWeekNo Resident tbl_WeeklyData;

       

       

       

       

      let v14WeekNo = Previous(maxWeekNo);

       

      tbl_14WeekInfo:

      LOAD SC_CODE,

           SC_CODE_M,

           SC_NAME,

           SC_GROUP,

           SC_TYPE,

           AVG_NO_OF_SHRS,

          // if(AVG_NO_OF_SHRS > 10000, '>10000', '<=10000')  as Flag,

           WEEKYEAR_KEY Resident tbl_WeeklyData

           Where WEEKNO = $(v14WeekNo);

          

        DROP Table temp;