Experience Salesforce

Date Literals in SOQL

What You’ll Learn

  • What Is Data Literals In SOQL?
  • Various Date Literal in Salesforce

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];
salesforce-developer
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.

cts-img
Rakshabandhan Sale