Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to write this query to extract records with date fields

gnewuser
Tera Contributor

I have a scoped application and a scheduled job where I am writing a query to get all the records that would pass the below condition:

 

IToday is within 30 days of the start date, and if today is before the start date

 

How do I do the within 30 days of the start date and also check if today is before the start date.

 

Thanks so much

3 REPLIES 3

SanjivMeher
Mega Patron
Mega Patron

You can build a query in the condition builder as below and then copy this query and use in an EncodedQuery in scheduled job

SanjivMeher_0-1712357529850.png

 


Please mark this response as correct or helpful if it assisted you with your question.

gnewuser
Tera Contributor

Thanks so much . for me the date field has a value of 2024-04-12 and that particular record doesnt show up when I apply the above query.

Can you post a screenshot of how you are using it?


Please mark this response as correct or helpful if it assisted you with your question.