- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 07:00 AM
Hi Gurus,
Is it possible to retrieve data that has an updated date equal to Yesterday AND two days ago AND three days ago.
I see there are built-in options for today, yesterday, last 7 days etc, but that goes back to far. I just need for the past three days.
Let me know if you think this is possible.
Thanks,
Rob
Solved! Go to Solution.
- Labels:
-
Analytics and Reports

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2020 06:47 AM
try now
usrCount = new GlideRecord("sn_imt_quarantine_unanswered_health_status_user");
usrCount.addEncodedQuery('u_unanswered_dateRELATIVELT@dayofweek@ago@3^u_unanswered_dateRELATIVEGT@dayofweek@ago@4');
usrCount.query();
var userArray = [];
while(usrCount.next()){
usrCount2 = new GlideRecord("sn_imt_quarantine_unanswered_health_status_user");
usrCount2.addEncodedQuery('u_unanswered_dateRELATIVELT@dayofweek@ago@2^u_unanswered_dateRELATIVEGT@dayofweek@ago@3^u_person=usrCount.u_person.name');
usrCount2.query();
while(usrCount2.next()){
gs.log('here1');
gs.log(usrCount2.u_person.name);
userArray.push(usrCount.sys_id.toString());
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 11:47 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2020 06:57 AM
so the encodedQuery which you applied is working fine on list view of the record ?
if you are using script i would recommend here , first run it over the background script and validate the result , this way it will be easy to troubleshoot .
usrCount = new GlideRecord("sn_imt_quarantine_unanswered_health_status_user");
usrCount.addEncodedQuery('u_unanswered_dateRELATIVEGT@dayofweek@ago@2'); // validate on list view first

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2020 07:05 AM
just confirming your requirement here,
you want number of record which has been updated between , 'yesterday' '2 days ago' and '3 days ago' ? please correct me if i did not understand it correctly ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2020 07:26 AM
Lets start with the number of records just updated 3 days ago only. THis doesn't appear to be the correct syntax....
usrCount.addEncodedQuery('u_unanswered_dateEQUAL@dayofweek@ago@3');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2020 07:36 AM
usrCount.addEncodedQuery("u_unanswered_dateRELATIVEGT@dayofweek@ago@3");
this will give the result , record updated 3 days ago as well as today record as well , this is what you want ?