COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: EArumugam on 12 Nov 2009 02:17:03 AM

Title: change the date format
Post by: EArumugam on 12 Nov 2009 02:17:03 AM
I need to display the date in header which user selected in date prompt.

I used paramdisplay(date) to display the date in report header.

but the date is displayed as 1 Aug,2009.

i changed the properties to date and set the format as MM/DD/YYYY.

eventhough i am getting the same format only.

please tell me is anyother way to change the dateformat.

it urgent.

thanks.
eas
Title: Re: change the date format
Post by: Gopinath on 12 Nov 2009 04:42:10 AM
create a data item in your report query using the prompt parameter

cast(?Date_Parameter? as Date)

now display this data item in your report header and format it
Title: Re: change the date format
Post by: EArumugam on 12 Nov 2009 05:44:24 AM
is there anyother to change the date format in paramdisplay itself, bcos my header some one line of message and two dates.

like...

"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX between date range from MM/DD/YYYY to MM/DD/YYYY"
Title: Re: change the date format
Post by: vishwanatha kn on 09 May 2012 06:52:47 AM
Hi,

Since the value in the ParamDisplayValue(); is in the form of String we can't directly format it to date, instead you can follow the below steps.

1. Add the below statement in the pageheader instead of ParamDisplayValue('orderDate_value1').
timestamp2date (string2timestamp(ParamValue('orderDate_value1')))
where as the 'orderDate_value1' is the one you want to format to date.
2. Select the above created field-> Navigate to 'Properties' tab ->'Data' block->'Data Format'->Select 'Format type' as 'Date'->
'Date separator' (-./ select your choice)->'Date Ordering' (Month,Day,Year-- your choice)-OK.
3. You are done now. Enjoy maadi :)

Regards,
Vishwanatha KN