Fetch records with query(startdate is greater than end date)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 06:51 AM
Hello Team,
I want to fetch the records(start date is greater than end date) from the table which contains more than 300 million records.
What is the best way to fetch the records from this big table.
query should be "start date is greater than end date".
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 11:55 PM - edited 08-23-2023 11:58 PM
Hello @Vinay49 ,
If you want to get only count then you can write below script in background script, I related you query with my incident records.
var grIncident= new GlideRecord('incident');
grIncident.addEncodedQuery('u_start_dateMORETHANu_end_date@hour@after@0');
grIncident.query();
if(grIncident.next()){
var count = grIncident.getRowCount();
gs.print("Count of records having start date is greater than end date : "+count);
}
If you want list of records then apply filter to list of records as attached image.