6 Replies Latest reply on Mar 28, 2018 8:42 AM by Ben Perlman

    Calculated Join Help: Not Giving Accurate Data.  Am I doing this right?

    Ben Perlman

      I am trying to join several sql server tables.

       

      One of them doesn't seem to be joining correctly, and the date is the issue.  I'm doing a left join, the table that I am joining to goes down to the day, the table that I am joining from goes down to month.  The format of the date in the table comes in as a string and is listed as YYYYMM

       

      Here is the join calculation I have on the left table:   DATE(DATETRUNC('month', [dtval Month]))

       

      Here is the join calculation I have on the right table: DATE(RIGHT([ListYYYYMM2],2)+ "-" + "1" + "-"+LEFT([ListYYYYMM2],4))

       

      The data comes in as 201803 (as a string)

      -doesn't give day.  I think this is the problem with how I have it written above.

       

      This gives me somewhat accurate data but not quite.  I'm wondering if there is a better calculation that I should be using?