function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sourav PSourav P 

Issue with a date field in the Report

Hi,
For a formula field where the outcome is date, in the report i am getting the below error,

Error running your report:
One of the date fields in your report was invalid. Check your records and formulas for errors. They may contain or produce non-existent dates, like February 30, or ones that are out of bounds. Edit this report and click <b>Remove All Columns</b> to start over.


Seems , the date formula is generating some invalid dates. How can i fix it ?
My formula below is like this,
 
(Currency_c /
Currency1__c)*(IF(TEXT(Type__c)="Cancellation",Date__c,Date1__c) - Date2__c)+ Date2__c



Where , Currency & Currency1__c are formula(currency) fields.

 
NagendraNagendra (Salesforce Developers) 
Hi Sourav,

May I suggest you please create another formula to calculate the no of days that need to be added to the Policy_Start_Date_from_quote__c field
possibly this will be the formula.
(Paid_to_date3__c/
Transacted_Premium__c )*(IF(TEXT(Type__c)="Cancellation",Effective_Date_from_Quote__c,Policy_End_Date_from_Quote__c) - Policy_Start_Date_from_quote__c)
then in your paid up to formula check if the resulting year is a leap year or not, also, check if month is February or not, then based on every month, while adding no of days, check if the no of days is less than or equal to the no of days in that month.

Refer to this post Hope this helps.

Kindly mark this as solved if it's resolved.

Thanks,
Nagendra