Between date query on two dates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2020 11:04 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2020 11:12 PM
Hi there,
Is this something you could simulate through the list? If so this article might help you further:
Utilizing the breadcrumb on lists to generate your query
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2020 11:30 PM
I'll be using this in a business rule where we have start and end selected.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2020 11:40 PM
Yes I understand. Though the question is, can you already achieve such a filter through the UI? If so, you could simply copy that query and use that within script. This could reduce complexity, this could help building the query visualy, etc..
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2020 11:55 PM
I tried copying that query and changing hard coded value to gliderecord object but it didn't work .
Can you please have a look at encoded query and let me know if I can change something in it
var b = new GlideRecord("u_multimedia");
b.addQuery("sys_id","21a214861b63041092b4fc88cc4bcbd9");
b.query();
if(b.next()){
var a = new GlideRecord("u_multimedia");
a.addEncodedQuery("u_event_start_dateBETWEENjavascript:b.u_event_start_date@javascript:b.u_event_end_date");
//a.addEncodedQuery("u_event_start_dateBETWEENjavascript:gs.dateGenerate('2020-03-17','00:00:00')@javascript:gs.dateGenerate('2020-03-18','00:00:00')");
a.query();
gs.info(a.getRowCount());
}