I used DATEPART combined with date5., and the data is from 2016 and 2017, Jan 01 - Aug 31 in both cases. . However, when I MERGE the two tables BY DATE, I receive 1 a 2 b 4 c 6 d 1 e 3 f 5 g 6 h In other words, the year part seems to have remained in date despite using the date5. format. Your example works perfectly, if only I knew how to apply it to my data properly.
... View more