Project a Date Field

To project a date field of type DateTime, use the EXTRACT() function on the date field in the SELECT statement.

1SELECT CloseDate
2FROM "OpportunityFiscalEMTimezoned"
3LIMIT 1;
CloseDate
2014-12-30 16:00:00

This example projects only the year from the DateTime field.

1SELECT EXTRACT(Year FROM CloseDate) As CloseDate_Year
2FROM "OpportunityFiscalEMTimezoned"
3LIMIT 1;
CloseDate_Year
2014