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
SueHallSueHall 

Calc the number of days between dates

I am trying to calculate the number of days (including weekends/holidays) between a date specified in an opportuntiy and the end of the current fiscal year. 
 
The formula I am using is {!ProjectedStartDate__c} - 20070701
 
This comes back with no errors but returns a value of 3/19/52639......
 
Does anyone have any suggestions?
dcouchdcouch
Try this:

(now()- {!ProjectedStartDate__c} )-(today()-date(2007,7,1))

Dave
EricBEricB
You need to specify the end of the fiscal year using the DATE function, which has the syntax DATE(year,month,day):

DATE(2007, 7, 1) - {!ProjectedStartDate__c}

The curious result you got was a result of subtracting 20,070,701 days from the Projected Start Date.  Interesting date overflow error!

Regards,
Eric
AppExchange Product Management

SueHallSueHall
Thanks Eric!