4 Replies Latest reply: Feb 20, 2013 5:21 AM by Selvakumar S RSS

    Between Date Range

      Hi,

       

      I want to create table with 3 Column (From Date,To Date and Sales Date) like this

       

      Between Date.PNG

       

      Now when i Choose the From Date (1/5/2012) and To Date (1/10/2012) then Sales date should list only from ( 1/5/2012 to 1/10/2012) some thing like this

       

      /---------------------------------------------------------------------
      Let StartCalendar = num(MakeDate(year(today())-1, '01', '01'));
      //Let EndCalendar = num(YearEnd(today()));
      //---------------------------------------------------------------------

      //Autogenerate Calendar with start and end Date

      DATE_RANGE_0:
      LOAD Date ($(StartCalendar) + RecNo()-1) as FromDate
      AutoGenerate ((today()-1) - $(StartCalendar)+1 );

      //Left Join with no keys
      Left Join (DATE_RANGE_0)
      LOAD FromDate as ToDate
      Resident DATE_RANGE_0;

      NoConcatenate
      DATE_RANGE_1:
      LOAD * Resident DATE_RANGE_0 where ToDate >= FromDate;

      drop Table DATE_RANGE_0;

      NoConcatenate
      DATE_RANGE_2:
      Load FromDate as SALES_DATE Resident DATE_RANGE_1 ;

      NoConcatenate
      DATE_RANGE_3:
      LOAD * Resident DATE_RANGE_2 where SALES_DATE >= FromDate and SALES_DATE <= ToDate;

       

      But error is coming.

       

      Please find the sample qvw attached.