> ## Content Index
> Fetch the complete content index at: https://www.namastesalesforce.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# SOQL: records modified since yesterday
- URL: https://www.namastesalesforce.com/snippets/soql-modified-since-yesterday/
- Published: 2026-04-26T09:00:00.000Z
- Updated: 2026-04-26T09:00:00.000Z
- Description: Relative date literals beat hand-built timestamps every time — and they respect the user's time zone.
- Author: Swarnil Singhai
- Tags: #snippet, #snippet-lang-soql, Admin, #Import 2026-09-03 19:13

```sql
SELECT Id, Name, LastModifiedBy.Name, LastModifiedDate
FROM Account
WHERE LastModifiedDate = YESTERDAY
   OR LastModifiedDate = TODAY
ORDER BY LastModifiedDate DESC
LIMIT 200
```

Relative date literals beat hand-built timestamps every time — and they respect the user's time zone.

## Gotchas

YESTERDAY is the user's calendar yesterday, not 'the last 24 hours' — for a rolling window use LastModifiedDate >= :DateTime.now().addHours(-24) from Apex instead.