Fetch records with query(startdate is greater than end date)

Vinay49
Tera Expert

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

1 REPLY 1

Community Alums
Not applicable

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.