- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 07:17 AM
Hi all,
Can I please get some starter advice on using the query parameter sysparm_query on the Incident table.
Is it possible to get a date range based upon the sys_created_on field? So for example I would like to get just elements that match sys_created_on>=2022-01-21 AND <2022-01-22, I tried this but it does not work, it returns
elements for 23rd, 24th etc,
sys_created_on%3E%3D2022-01-21&sys_created_on%3C2022-01-22
On the understanding that %3E%3D is >= and %3C is < (less than).
Is it not possible to use multiple parameters with sys_created_on?
Screenshot of query running in Postman with values greater that
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 07:25 AM - edited 01-24-2023 07:25 AM
It should be like this
sys_created_on>javascript:gs.dateGenerate('2022-01-22','00:00:00')^sys_created_on<javascript:gs.dateGenerate('2022-01-23','23:59:59')
Full link should be like this
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 07:23 AM
Hi,
Please create your desired filter within the application. Then you can right click on the query itself and copy it. You can use that in the sysparm_query to query the instance. Also the dynamic queries (last day, last month etc.) work perfectly.
Regards,
Hayo
Please mark the solution as correct, if the answer provided has resolved your query.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 07:25 AM - edited 01-24-2023 07:25 AM
It should be like this
sys_created_on>javascript:gs.dateGenerate('2022-01-22','00:00:00')^sys_created_on<javascript:gs.dateGenerate('2022-01-23','23:59:59')
Full link should be like this
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2023 12:03 AM
Hi @Basheer
Thanks for the example. I will have to have a play around with this later today in Postman to see if I can get it working.
From your example, can I ask if the caret symbol means AND?
sys_created_on>javascript:gs.dateGenerate('2022-01-22','00:00:00')^sys_created_on<javascript:gs.dateGenerate('2022-01-23','23:59:59')
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2023 12:34 AM
Yes caret (^) is AND
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.