How to extract the year and/or month from a date field using Cognos 8

Technote (FAQ)


Question

Is it possible to view the year and/or month from a date field using Cognos 8?

Answer

Use the the extract function to obtain the portion of the date required.

Steps:

The extract function is found under the Common Functions folder in the Expression Editor of Report Studio. The syntax is:

    extract(datepart, datetime_exp)

where datepart is the date portion you wish to view (one of day, month year, minute, hour, second), and datetime_exp is the date query item for which you wish to display a datepart.

Historical Number

1019996

Rate this page:

(0 users)Average rating

Document information


More support for:

Cognos 8 Business Intelligence
Report Studio

Software version:

8.2

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Reference #:

1345500

Modified date:

2010-01-15

Translate my page

Machine Translation

Content navigation