3 Replies Latest reply: Jan 8, 2015 10:42 AM by Simone Spanio RSS

    Problem declaring a variable in script using LET

      Hi all

       

      I have the following code in script:

      BENCH_DTE:

      LOAD BASE.DATE as DATE

      resident BSE

      WHERE

      month(BSE.DATE) = 'Dec'

      ORDER BY BSE.DATE ASC

      ;

      Let vbench_dte2 = Fieldvalue('DATE',1);

       

       

      LET vbench_dte = peek('DATE',0,'BENCH_DTE');

       

      After stepping through the code it seems both variables are been declared as NULL.  There are 2 rows in table BENCH_DTE with the values 31/12/2013 & 31/12/2014.  What I am trying to do is to assign the minimum date, hence the reason for the ORDER BY statement i.e. I require 31/12/2013 to be assigned to the variables.  Is the above syntax correct for FIELDVALUE AND PEEK?

       

      thanks in advance