SAP Knowledge Base Article - Public

3766070 - How to calculate number of days between two dates excluding the start and end date

Symptom

  • Calculate the total number of days between two dates excluding the start and end date
  • Calculate and auto populate the total number of travel days using the logic: Travel Days = (Business Start Date - Departure Date) + (Return Date - Business End Date)

Environment

  • SAP SuccessFactors HCM Suite
  • Metadata framework

Resolution

To calculate the total number of days:

  1. Use the function: CalculateDurationInSecondsBetweenTwoDateTimeValues()
  2. Divide the result by 86400 to get the actual day difference excluding the start and end date
  3. This will also give you the total number of travel days as per the logic: Travel Days = (Business Start Date - Departure Date) + (Return Date - Business End Date)

See Also

Keywords

sf, sap, successfactors, travel, travel days, calendar days, mdf, duration between dates, total days, excluding start date, excluding end date , KBA , LOD-SF-MDF , Metadata Framework , How To

Product

SAP SuccessFactors HCM Suite 2605