What saved search formula can I use to count the n...
# ask-stanley-ai
c
What saved search formula can I use to count the number of date/time fields between two date/times?
c
AI generated answer (using internal Slack threads):
To calculate the difference between two date/time fields in a saved search formula, you can use the following formula:
Copy code
CASE WHEN {date1} > {date2} THEN {date1} - {date2} ELSE {date2} - {date1} END
This formula will return the difference in days between the two date fields. If you want the difference in hours, you can multiply the result by 24. However, if you want to calculate the difference only during specific working hours (e.g., 80000 am to 30000 pm), you would need to create a more complex formula that takes into account the working hours. Unfortunately, this is not straightforward and might require some custom scripting. For calculating the time between two system notes dates, you can use a similar approach. However, you would need to find a way to identify the system notes that correspond to the transition from stage 1 to stage 2. This might involve using a combination of the system notes' date/time and the values of the fields that change during the transition. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.877596
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.874743938
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.861985564
Please provide your feedback on this answer.