If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

extract the year and month from a date field

Started by gatorfe, 01 Jun 2011 11:00:26 AM

Previous topic - Next topic

gatorfe

Hello, how can I  extract the year and month from a date field?  Currently the date field on the report shows as 2011-06-01 and I want to show it as 2011-06. Thanks in advance for any suggestions.

cognos123

Change Data Format default  to date  and  change properties for  date 

Date separator '-'
date ordering  'yr,month,day'
Display years 'Yes'
Display Months ' two digits'
Display days and weekdays 'No'

:)

cognos123

You can try this one also

TO_CHAR([dataitem],'YYYY - MM')