Datediff between date type field incorrectly calculated

Important note: To help us resolve your issue as quickly as possible, please ensure to fill out all the sections below. Do not share any private information such as email addresses or phone numbers - This is a public Forum!


Briefly describe (1-2 sentences) the Bug you’re experiencing:
Datediff between 2 date field is not calculated correctly.

Steps to reproduce:

  1. Created 3 custom field with type set as Date.
    A. Plan Start Date
    B. Actual Start Date
    C. Actual End Date
  2. Create 2 custom field with type set as formula
    A. Plan Duration = [System] Due date - [Custom field] Plan Start Date + 1
    B. Actual Duration = [Custom field] Actual End Date - [Custom field] Actual Start Date + 1

Browser version:
Google Chrome - Version 120.0.6099.200 (Official Build) (64-bit)

What version of Asana are you using (Basic/Premium/Business/Enterprise)?
Starter [On Trial]
Upload screenshots below:


Hmm yes, I replicate this issue. It appears there is a limitation in the use of date fields in formulas, which results in unexpected results like “46,081” instead of “3w 4d”. Please note that if you hadn’t attempted to do the completely reasonable act of adding 1 to your formula, you would have gotten a “3w 4d” type answer.

You can probably work around this limitation by “chaining” custom formulas together, and using the special “DateAdd” function, as alluded to in this article: https://help.asana.com/hc/en-us/articles/15956483311259-Formula-custom-fields

:expressionless:

Calling @Richard_Sather for potential help.

1 Like

Thank you @Stephanie_Oberg1
I’ve tried the suggested workaround. But the result still the same.


The goals on adding 1 in the formula is to include the start / end date.
I.e. Start date = 2 Jan; End Date = 2 Jan ; It should be considered as 1 Day (Working Day)
If we use only End Date - Start Date, it will return 0.

Hi @Handra2 , have a look at point 1. in this post:

The issue is that since you add a number to a date calculation, Asana converts the result into minutes. So the workaround is to simply divide your result by 1440 (minutes within a day) :wink:

1 Like

This topic was automatically closed after 4 days. New replies are no longer allowed.