3 Replies Latest reply: Nov 14, 2012 4:43 AM by Jason Michaelides RSS

    load data with latest date

    lin ye



      it's kind of a miss or hit thing. sometimes it works and other times it doesn't.

      I need to find values with latest date. I usually use this method, but it's too long. Any good suggestion to make my life easier? thanks



      sql select distinct load_date from tbl1;


      load max(load_date) as MaxDate

      resident P;

      let vMaxD = peek('MaxDate', 0, 'P')

      drop table P;

      drop table P2;



      sql select * from tbl1

      where load_date ='$(vMaxD)';