Experience Salesforce
Date Literals in SOQL
What You’ll Learn
- What Is Data Literals In SOQL?
- Various Date Literal in Salesforce
Topics
- SOQL Basics (Salesforce Object Query Language)
- How to Write SOQL in APEX
- SOQL Variable Binding in APEX
- SOQL Keywords
- Date Literals in SOQL
- SOQL Aggregate Functions
- Child to Parent Relationship
- Parent to Child – Relationship Queries in SOQL
- SOQL Multi level Relationships
- SOQL Return Type
- Salesforce Dynamic SOQL
- SOQL ’for’ Loops
What Is Data Literals In SOQL?
A date literal in SOQL is a fixed expression representing a relative time range, such as last month, this week, or next year.
Whenever we write date literals, it substitutes a value that should be there and which is dynamic.
Various Date Literal in Salesforce
List<Account> accList;
accList = [SELECT Id FROM Account WHERE createdDate = Yesterday];
accList = [SELECT Id FROM Account WHERE createdDate = Today];
accList = [SELECT Id FROM Account WHERE createdDate = Tomorrow];
accList = [SELECT Id FROM Account WHERE createdDate = Last_Week];
accList = [SELECT Id FROM Account WHERE createdDate = Last_Month];
Next Topic
Need Extra Support? Our FREE study materials have got you covered.
Our expert-prepared study materials provide the answers you need. Clear your doubts and improve your skills with detailed notes from industry professionals.