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

 

3 REPLIES 3

Dr Atul G- LNG
Tera Patron

Hi @paulmagaling 

 

OOTB it is not possible. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

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
Kilo 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');
  }
})();

 

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.

Kind Regards,
Azar
Serivenow Rising Star
Developer @ KPMG.