Skip to content

Instantly share code, notes, and snippets.

@shinchit
Created September 5, 2019 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinchit/6f7572cdede33a2e9cabc0ecec4eb7de to your computer and use it in GitHub Desktop.
Save shinchit/6f7572cdede33a2e9cabc0ecec4eb7de to your computer and use it in GitHub Desktop.
String soql = 'SELECT Id, Name FROM Opportunity'
+= ' WHERE'
+= ' DAY_ONLY(convertTimeZone(CreatedDate)) >= ' + String.valueOf(fiscalLastYearStartDate)
+= ' AND'
+= ' DAY_ONLY(convertTimeZone(CreatedDate)) <= ' + String.valueOf(fiscalLastYearEndDate);
List<Opportunity> opportunities = Database.query(soql);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment