mardi 21 juin 2016

Converting a Date Format to YYYYMM in Cognos Report Studio

I have a date column in a format 12 May, 2014 I want to convert that into yyyymm/ 201405 format. i tried multiple options like

extract(year, sys_date)*100 + extract(month, sys_date))*100
cast(extract( year, sys_date), varchar(4)) + cast(extract( month, sys_date), varchar(2))

This one works but returns me in YYY,YMM format.

CAST(to_char(sys_date, 'YYYYMM'), INT )

For the above two, it gives an error:

 An error occurred while performing operation 'sqlOpenResult' status='-28'

Can some one please guide. Thank you in advance.

Aucun commentaire:

Enregistrer un commentaire