Mapping DATEPART functions: DatePartMapper element
DATEPART takes two arguments: a date part and a timestamp. It returns the part of the timestamp specified by the date part:
Integer datepart( datepart Varchar, value Timestamp )
The DatePartMapper element is used to customize the mappings for the date parts listed in Table 11-10. The table also shows the default template for each date part.
Example: Mapping the DATEPART functions
Your database has a different syntax for the DATEPART functions. You define each part using a mapping:
<DatePartMapper>
  <FunctionMappings>
    <FunctionMapping FunctionName="DATEPART"
      DatePart="yyyy">
      TO_NUMBER (TO_CHAR ($P0, 'YYYY'))
    </FunctionMapping>
    …
    <FunctionMapping FunctionName="DATEPART"
      DatePart="y">
      TO_NUMBER (TO_CHAR ($P0, 'DDD'))
    </FunctionMapping>
  </FunctionMappings>
</DatePartMapper>

Additional Links:

Copyright Actuate Corporation 2012