Date Filter between Months

paulmagaling
Tera Contributor

Is there any way to filter a list between months without the year?
e.g. April to September, October to March

paulmagaling_0-1769434713084.png

 

5 REPLIES 5

Dr Atul - LNG
Tera Patron

Hi @paulmagaling 

 

OOTB it is not possible. 

It seems impossible but, I found a way to overcome this requirement.

To get all records between specific month, I used the "trend" operator.

paulmagaling_0-1769441772980.png

 

Its_Azar
Mega Sage

Hi there @paulmagaling 

not with the out-of-the-box Date filter alone- not possible.
But yes, it is can be done with either relative date logic or a scripted/encoded query approach,  whats the usecase?

 

You can use a before query BR if you need it to be reusable 

(function executeRule(current, previous) {
  var m = new GlideDateTime().getMonthUTC() + 1;

  if (!(m >= 4 && m <= 9)) {
    current.addQuery('sys_id', 'ISEMPTY');
  }
})();

 

For the platform analytics dashboard, I need to filter the asset_task table using the contract.ends, and get the records from this year's October to next year's March.