I added the code below to a SharePoint calculated column in order to get today's date, and it works well, however, I will need to add another calculated column to get the date difference between "Today" and "Last Reported Date".
I have converted the "Last Reported Date" to a number format, and "Today" column is in number format already, but when I add a simple formula
= [today]-[Last Reported Date]
I always get the result
#VALUE!
I assume it is because the [today]
column, but haven't figured out how to convert the value to a number for calculation
="<img src='/_layouts/images/blank.gif' onload=""{"&" var today=new Date();"&" var dd=today.getDate();"&" var mm=today.getMonth()+1;"&" var yyyy = today.getFullYear();"&" today=mm+'/'+dd+'/'+yyyy;"&" this.parentNode.innerHTML=today;"&"}"">"