1 Reply Latest reply: Nov 7, 2010 2:32 PM by Miguel Angel Baeyens de Arce RSS

    How can i get max date and last values?

      Hi, i have an Historic table with records like:

      ID USER H_DATE SITUATION REASON
      01 1 10/01/10 ENABLED NEW
      02 2 02/02/10 ENABLED NEW
      03 3 03/02/10 ENABLED RETURN
      04 1 01/04/10 DISABLED HOLIDAY
      05 3 18/02/10 FIRED LEAVE
      06 1 01/05/10 ENABLED RETURN
      07 3 02/05/10 ENABLED RETURN
      08 2 01/07/10 DISABLED SICK
      09 3 05/08/10 DISABLED HOLIDAY
      10 1 05/09/10 TRANSFER NEW DESTINATION
      11 2 06/09/10 ENABLED CURE
      12 1 08/09/10 ENABLED RETURN
      13 3 10/09/10 ENABLED RETURN

      I need that when selected the SITUATION = ENABLED and filter the DATE < 01/09/10 the obteined data group by USER must be:

      P.S: the date filter is very important and i done into the load script with: where date(H_DATE,'DD/MM/YYYY') < date($(vLastDate),'DD/MM/YYYY')

      ID USER H_DATE SITUATION REASON
      06 1 01/05/10 ENABLED RETURN
      02 2 02/02/10 ENABLED NEW
      07 3 02/05/10 ENABLED RETURN

      Sorry for my poor english, but i hope you can help me!

      Thanks!!