2 Replies Latest reply: Oct 19, 2012 1:38 PM by Roel Sable RSS

    Variable Date

      Hello!  I have a load script that works but I use a hard-coded date (highlighted in red below). But I want to use an arbitrary date value, vStartDate, instead of the hard-coded date. How can I use the value of vStartDate?

       

       

      LET vStartDate = makedate(Year(Today()),01,01);

       

      YTDtotals:

       

      LOAD

      item,

      ytd_units,

      ytd_cost,

      ytd_price;

       

      SQL SELECT t3.item,

          sum(t1.units) as ytd_units,

          sum(t1.total_cost) as ytd_cost,

          sum(t1.total_price) as ytd_price

      FROM transitem t1, trans t2, product t3

             where t1.trn_uid = t2.trn_uid

             and t1.product_uid = t3.product_uid

             and t2.trn_date > '2011-01-01'

             group by t3.item;