0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Date Functions

Posted at

Date functions in SOQL queries allow you to group or filter data by date periods such as day, calendar month, or fiscal year.

例:
SELECT CALENDAR_YEAR(CreatedDate), SUM(Amount)
FROM Opportunity
GROUP BY CALENDAR_YEAR(CreatedDate)

SELECT CreatedDate, Amount
FROM Opportunity
WHERE CALENDAR_YEAR(CreatedDate) = 2009

CALENDAR_MONTH()
CALENDAR_QUARTER()
CALENDAR_YEAR()
DAY_IN_MONTH()
DAY_IN_WEEK()
DAY_IN_YEAR()
DAY_ONLY()→Returns a date representing the day portion of a dateTime field.
FISCAL_MONTH()
FISCAL_QUARTER()
FISCAL_YEAR()
→This function is not supported if your organization has custom fiscal years enabled. See "Define Your Fiscal Year" in the Salesforce Help.
HOUR_IN_DAY()→Returns a number representing the hour in the day for a dateTime field.
WEEK_IN_MONTH()
WEEK_IN_YEAR()

Link:
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_date_functions.htm

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?