How to calculate the number of years or days between two days

Comments

1 comment

  • Official comment
    Avatar
    Franck Reyherme

     

    Hi Sal,

    Hope all is well with you! Assuming you are using custom reporting (and not SQL), the EL Start Date in your data file has been imported as text (aka “String”). So, the first step is to convert the date into a real date value so that you can perform the date calculation. This help document will walk you through the process of converting your text date into a real date, step-by-step.

    Once that is done, follow these steps:

    1. Create a new variable called “Years since EL Start Date” or something like that
    2. Go to the Properties tab and click the pencil icon to the right of the “Expression” field
    3. Enter an expression that looks something like this (you will be using the variable that you created in earlier):
      YEARS($V{Real EL Start Date}, TODAY())
      
    4. Set the “class” of the variable to java.lang.Integer
    That’s it. You now have a variable that will tell you the number of years since the EL Start Date for each student.
     
    I hope that helps! If you run into any issues, feel free to book an appointment with me. Click this link to see my availability and book an appointment with me. Thanks!

    I typically make appointments available 2-3 weeks in advance. If you’re looking at dates more than 2-3 weeks out, you probably won’t see any availability, but appointments slots will likely be added as we get closer to the date.

     

Please sign in to leave a comment.