For tests proposes, I need to get the current system date. On Oracle we could use:
SELECT SYSDATE FROM DUAL
On SQL SERVER, we can use:
SELECT GETDATE() AS CurrentDateTime
How to query the system date time using SOQL?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
If you cannot use Apex, and need to use SOQL only, then binding is not allowed. Which means you cannot use
With that in mind, you can use Date Literals, such as
TOMORROW, and so on.
SELECT CreatedDate FROM Account WHERE CreatedDate <= TODAY SELECT CreatedDate FROM Account WHERE CreatedDate <= YESTERDAY