Condition Builder: Query / Show Records with date exactly 60 days from today

Desmo
Mega Guru

Hello,

I'm scripting a Scheduled Job.

To get a query, I tried using the condition builder to show records where Service End date field is exactly 60 days from today--then copy the query. I saw posts stating to use the Relative operator. It mentioned using 'on or after'. I do not see 'on or after' as a choice.

find_real_file.png

I then tried using this query:

service_endRELATIVEEE@days@ago@-60

It works, but not the way I expected. It found for records with a Service End within 60 days from now.

 

Desmo

1 ACCEPTED SOLUTION

Mike Patel
Tera Sage

I have scheduled job to send email to users who's password will expire in next 30 days.

I do something like below

var Days = gs.daysAgoStart(-30).split(' ');  
var gr = new GlideRecord('sys_user');  
gr.addQuery('u_pwd_expires', 'CONTAINS', Days[0]); 
gr.query();  
while (gr.next()) {  
	gs.eventQueue('password.expire.reminder', gr, gr.u_pwd_expires, gs.now()); 
}

You can do something like that

View solution in original post

1 REPLY 1

Mike Patel
Tera Sage

I have scheduled job to send email to users who's password will expire in next 30 days.

I do something like below

var Days = gs.daysAgoStart(-30).split(' ');  
var gr = new GlideRecord('sys_user');  
gr.addQuery('u_pwd_expires', 'CONTAINS', Days[0]); 
gr.query();  
while (gr.next()) {  
	gs.eventQueue('password.expire.reminder', gr, gr.u_pwd_expires, gs.now()); 
}

You can do something like that