How do you do it in the script so that for a certa...
# ask-stanley-ai
r
How do you do it in the script so that for a certain date you search for all the results where datecreated is within a 3-hour window in the past and 3 hours into the future?
c
AI generated answer (using internal Slack threads):
To search for all the results where
datecreated
is within a 3-hour window in the past and 3 hours into the future, you can use a formula in your saved search criteria. You can use the
TO_DATE
function to convert a string to a date, and then subtract the
datecreated
field from it. This will give you the number of days as a floating point value. You can then compare this value to the desired range. Here is an example of how you can do this: 1. Create a new saved search. 2. In the Criteria section, add a new filter. 3. Select "Formula (Numeric)" as the filter type. 4. In the Formula field, enter the following formula:
TO_DATE({today}, 'YYYY-MM-DD HH24:MI:SS') - {datecreated}
5. In the operator field, select "between". 6. In the value field, enter "-0.125 and 0.125". This represents a 3-hour window in the past and 3 hours into the future, as each day is represented as 1, so 3 hours is 0.125 of a day. This will return all records where
datecreated
is within a 3-hour window in the past and 3 hours into the future. ****** 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.837605119
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.827636242
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.827034116
Please provide your feedback on this answer.