1 2 Previous Next 19 Replies Latest reply on Aug 17, 2016 5:16 AM by Cheryl Morgan

    Count Difference Between Months

    Cheryl Morgan

      I am needing to count month between collect dates. I need to know if the test was run in the last 3 months. Below is the code I used but it is giving me a count of zero, but I know they had 3 of the same tests run in a year because I can see the dates. I understand the first one have a count of zero, because there is no test before that, but the count for the other should be 3, 5 respectively. Additionally, I am using the patients medical record number. The collect date is the only way date that can be used.

       

      Any help is greatly appreciated.

       

      DATEDIFF('month',[Collect Date],[Collect Date])

      Dates of the Tests.
      1/8/2015
      4/23/2015
      9/30/2015

       

      I have extracted the first 100,000 rows.

        1 2 Previous Next