Calculating Days between Dates

4 posts / 0 new
Last post
mickeymurray
Offline
Joined: 04/10/2021 - 01:19
Calculating Days between Dates

Hi! I need to calculate the days between the field date and 3/31/2019. I am trying to do this in Equation Editor and cannot use the @Age function. I entered in the following: "20190331" - INVOICE_DATE and the equation error "mismatch field type" is showing up. Any help would be appreciated. 

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

You have to add @ctod around it.  So do @ctod("20190331", "YYYYMMDD") and that should fix the problem.

mickeymurray
Offline
Joined: 04/10/2021 - 01:19

I am still getting an error. I have attached the screenshot. Thank you for your help. 

Images: 
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi MIckey,

That is because what I gave you was only for the date field.  If you are using the @age the entire function would be something like this:

@age(@ctod("20190331", "YYYYMMDD"), INVOICE_DATE)