Salesforce Fact #632 | WEEK_IN_MONTH() in SOQL
Suppose we need to find out the number of account records created grouped by the week in the month. We can use the WEEK_IN_MONTH() function in SOQL for this:
SELECT WEEK_IN_MONTH(CreatedDate), Count(Id) FROM Account WHERE CreatedDate = THIS_MONTH GROUP BY WEEK_IN_MONTH(CreatedDate)
Comments
Post a Comment