query records created before last 6 months
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2018 01:27 PM
Hi,
how can I get records from incident table created before Last 6 months?
I tried javascript:gs.daysAgo(180) but the count is not exactly matching.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2018 01:37 PM
Hi
Use this script to find records which were created in last six months from today
var gr= new GlideRecord('incident');
gr.addEncodedQuery('sys_created_on>=javascript:gs.beginningOfLast6Months()');
gr.query();
while(gr.next()){
var num=gr.number;
gs.log(num);
}
Use this query if you want the records created before last six months
sys_created_on<=javascript:gs.beginningOfLast6Months()
Mark the answer as Correct/Helpful based on its impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2021 08:00 AM
Can this be modified to select records created on the last 12 months?