Wednesday, November 16, 2011

Salesforce API - Dates

Query with DateTime field in Salesforce

If you have to work with DateTime field in Salesforce, consider next items:

1. Don't use quote
For example:
SELECT Id FROM Opportunity WHERE CreatedDate > 2005-10-08

2. Use DateTime literals: YESTERDAY, TODAY, TOMORROW, LAST_WEEK, THIS_WEEK, NEXT_WEEK, ...
For example:
SELECT Id FROM Account WHERE CreatedDate = LAST_WEEK

3. DateTime in Salesforce is UTC format
For example(C#):
string strSQL = "SELECT Id FROM Opportunity WHERE CreatedDate > " + DateTime.Today.ToString("yyyy-MM-dd");

No comments:

Vectorize PNG to SVG

No Login  [1] https://www.freeconvert.com/png-to-svg   [2] https://svg-converter.com/potrace  Loging required [2] https://www.recraft.ai [3]...