Expand my Community achievements bar.

Join us LIVE in San Francisco on November 14th for Experience Makers The Skill Exchange. Don't miss out on this free learning event!

Date Difference Between Project Planned Completion Date and Custom Date Field (Ignoring the Time Stamp of the Project)

Avatar

Level 3

Hi! 

I've been digging into the community site to try and figure this out myself but haven't found anything. 

 

Is is possible to build a custom form field that displays a number, that will compare the project planned completion date with a custom field date, in my instance known as the Report Delivery Date, but not take into account the timestamp on the project planned completion date? My numbers between the two dates are off, and I can't seem to figure out why, other than maybe it's grabbing the timestamp of the planned completion date of the project but trying to compare it to a date field that doesn't have a timestamp?

 

 

3 Replies

Avatar

Level 7

You are correct--I've run into issues when comparing native WF dates to custom field dates.  The dates themselves can be the same, but the presence of a timestamp in the native date field causes a comparison to flag the dates as being different.

In your custom calculated field, you can use the CLEARTIME function to get rid of the timestamp.

cleartime function.png

Avatar

Level 3

I'm not the best with calculations, where would this cleartime text go in a formula that looks like this?

 

WEEKDAYDIFF({plannedCompletionDate}, {DE:Report Delivery Date})
 
and would it also work if I replaced WEEKDAYDIFF with DATEDIFF? This one seems to produce some big wacky numbers. 

Avatar

Level 7

Try this to see if it works:

WEEKDAYDIFF(CLEARTIME({plannedCompletionDate}), {DE:Report Delivery Date})

I would think that WEEKDAYDIFF should give you smaller values than DATEDIFF if the dates don't match.