Sunday, December 16, 2018

Create a search for transactions created within a specific date/time range

1. If date filters are Yesterday and Today, it allows to enter specific time.

* Under the Criteria tab, check the box for Use Expressions and set the filters as follows:

a. - First Parens column = Open Parenthesis
- Filter = Date Created
- Description = is on or after yesterday 2:00 pm
- And/Or column = And
b. - Filter = Date Created
- Description = is on or before today 9:30 am
- Second Parens column = Close Parenthesis

2. If date filter chosen does not allow to enter specific time, consider using simple SQL formula such as as follows:

a. Sample when Date Created is between Yesterday 2PM and Today 9:30AM

case when {datecreated} between (to_date(concat(to_char(sysdate-1,'mm/dd/yyyy'),' 14:00:00'), 'mm/dd/yyyy hh24:mi:ss')) and (to_date(concat(to_char(sysdate,'mm/dd/yyyy'),' 09:30:00'), 'mm/dd/yyyy hh24:mi:ss')) then 1 else 0 end

b. Sample when Date Created is between 9:30AM and 2PM of Today:

case when {datecreated} between (to_date(concat(to_char(sysdate,'mm/dd/yyyy'),' 09:30:00'), 'mm/dd/yyyy hh24:mi:ss')) and (to_date(concat(to_char(sysdate,'mm/dd/yyyy'),' 14:00:00'), 'mm/dd/yyyy hh24:mi:ss')) then 1 else 0 end

* There is no need to enable Use Expressions with these formula.
* Use Formula (Text) as filter in the Criteria tab.
* Set Description to 1.
* For other date/time ranges, replace the specific time in the formula.
* Sysdate refers to system or current date. Sysdate means Todays date. Sysdate-1 means Yesterday, Sysdate-2 means the day before yesterday, and so on.

 

 

No comments:

Post a Comment