8 Replies Latest reply on Jul 3, 2018 8:47 AM by Shinichiro Murakami

    Need help with Date calculations

    Swathi Reddy

      Table 1 inner joined with Table 2

           TABLE 1

      Activated_Datecolumn1Count of orders of table1Count of orders of table 2
      4/18/2018A5
      4/19/2018B6
      4/20/2018C8
      4/21/2018D10
      4/22/2018E50
      4/23/2018F20
      4/24/2018G30

       

      TABLE 2

         

      Track Out Datecol1Count of orders of table 2
      3/11/2018A30
      4/2/2018B20
      4/3/2018C10
      4/4/2018D10
      4/5/2018E10
      4/6/2018F10
      4/7/2018G10
      4/8/2018H10
      4/9/2018I10
      4/10/2018J10
      4/11/2018k10
      4/12/2018L10
      4/13/2018M10
      4/14/2018N10
      4/15/2018O10
      4/16/2018.10
      4/17/2018.10
      4/18/2018A10
      4/19/2018A10
      4/20/2018A10
      4/21/2018A10
      4/22/2018A10
      7/3/2018A10

       

      Output:

          

      Activated_Datecolumn1Count of orders of table1Count of orders of table 2
      4/18/2018A560
      4/19/2018B6
      4/20/2018C8
      4/21/2018D10
      4/22/2018E50
      4/23/2018F20
      4/24/2018G30

       

      From the day  of activation(Activated_date)  till today(from Track out date), I need the count of orders from table 2. In this case, for 'A' activated date is 4/18/2018 so I need count of orders of table 2 from 4/18/2018 till today (7/3/2018)which will be 60

       

      Any help is appreciated!

       

      Thanks,
      Swathi