I need a saved search to run for a 24 hour period ...
# general
s
I need a saved search to run for a 24 hour period that is not tied to one day. I need to choose Sales Orders that were created between 7pm yesterday and 7pm today. Any idea on how to do this? Someone suggested that I use Date Created after yesterday @7pm and even showed me a screen shot but my system will not allow me to set a time. When I do, and hit set, it removes it and leaves only "yesterday".
s
You can try using a Formula (Numeric) criteria filter. Set the Formula to
{today} - {createddate}
which returns the number of days elapsed as a floating point value, then filter on results
less than or equal to
value
1
that gives the last 24 hours. If you need a different range, you may need to use a between filter, for example,
between
0.125
and
1.125
would return everything that was created more than 3 hours and less than 27 hours ago.
For a fixed time range, you can use
to_date('2019-10-10 19:00', 'YYYY-MM-DD HH24:MI') - {createddate}
, which calculates the time elapsed from the Date Created until 10/10 7:00 pm
s
Thanks! When I include {today} in a column, it shows only the date... as opposed to {date created} which shows a datetime. So how can it generate the difference between a specific time? I will be running this at 7pm each day so if it does show the last 24 hours then this will work. But it seems strange that {today} only shows the current date and not the current datetime...
s
Try using a Formula (Date/Time) column with {today} if you want to see the time portion. If using Formula (Date), it will not show the time portion. Alternatively, you can use the
TO_CHAR
to convert {today} to a string:
TO_CHAR({today})
The function takes an optional second parameter where you can specify an output format, otherwise it uses a default format.
s
Thanks