diff --git a/Core ServiceNow APIs/GlideRecord/Get Records Older than X Days/README.md b/Core ServiceNow APIs/GlideRecord/Get Records Older than X Days/README.md new file mode 100644 index 0000000000..f29bfa3419 --- /dev/null +++ b/Core ServiceNow APIs/GlideRecord/Get Records Older than X Days/README.md @@ -0,0 +1,23 @@ +# Query records older than N days efficiently + +## What this solves +You often need to find records older than a threshold without loading the world into memory. This snippet: +- Uses GlideDateTime maths to compute a date boundary +- Uses encoded queries with index-friendly operators +- Streams results and logs a compact summary + +## Where to use +Background Script, Script Include utility, or any server-side context. + +## How it works +- Compute a past date with GlideDateTime and subtract days +- Build an encoded query like `opened_at