Date Literals In SOQL!
Here are the list of date literals available in SOQL.
1. Today:
- TODAY
This can be used in a WHERE clause to retrieve records that were created or last modified today.
2. Yesterday:
- YESTERDAY
This can be used in a WHERE clause to retrieve records that were created or last modified yesterday.
3. This week:
- THIS_WEEK
This can be used in a WHERE clause to retrieve records that were created or last modified within the current week.
4. Last week:
- LAST_WEEK
This can be used in a WHERE clause to retrieve records that were created or last modified within the previous week.
5. This month:
- THIS_MONTH
This can be used in a WHERE clause to retrieve records that were created or last modified within the current month.
6. Last month:
- LAST_MONTH
This can be used in a WHERE clause to retrieve records that were created or last modified within the previous month.
7. This year:
- THIS_YEAR
This can be used in a WHERE clause to retrieve records that were created or last modified within the current year.
8. Last n Days:
- LAST_N_DAYS:n (replace n with the number of days)
This can be used in a WHERE clause to retrieve records that were created or last modified within the last n number of days.
9. Next n Days:
- NEXT_N_DAYS:n (replace n with the number of days)
This can be used in a WHERE clause to retrieve records that will be created or last modified within the next n number of days.
10. This quarter:
- THIS_QUARTER
This can be used in a WHERE clause to retrieve records that were created or last modified within the current quarter.
11. Last quarter:
- LAST_QUARTER
This can be used in a WHERE clause to retrieve records that were created or last modified within the previous quarter.
12. Next quarter:
- NEXT_QUARTER
This can be used in a WHERE clause to retrieve records that will be created or last modified within the next quarter.
13. This fiscal year:
- THIS_FISCAL_YEAR
This can be used in a WHERE clause to retrieve records that were created or last modified within the current fiscal year.
14. Last fiscal year:
- LAST_FISCAL_YEAR
This can be used in a WHERE clause to retrieve records that were created or last modified within the previous fiscal year.
15. Next fiscal year:
- NEXT_FISCAL_YEAR
This can be used in a WHERE clause to retrieve records that will be created or last modified within the next fiscal year.
Follow Us