Date Difference

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ayday
    Junior Member
    • Feb 2017
    • 5

    Date Difference

    Hi,
    I have created an entity called Leaves that has two date fields: fromDate and toDate. I also created a read only INT field daysRequested.

    I created this formula for my entity:
    daysRequested = (toDate - fromDate) + 1

    That is supposed to calculate the number of days between the two date fields.

    The values I get for whatever dates I submit is 1 which tells me the difference between toDate and fromDate is not working.

    What am I doing wrong? Is there a function to subtract two dates?

    Thank you.
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Don't see how to realize it with Formula.
    But you can develop it.
    On version 4.4.1 open /application/Espo/Modules/Crm/Resources/metadata/entityDefs/Meeting.json, look at field "duration". You need "select" and "orderBy" parameters

    Comment

    • wtconseil
      Active Community Member
      • Apr 2015
      • 335

      #3
      Thanks for the tricks Tanya !! I had the same need!

      Comment

      Working...